We had a handful test updates since we accepted 82ebb0b (add test_cmp
function for test scripts). This fixes them up.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* jk/portable:
t6000lib: re-fix tr portability
t7505: use SHELL_PATH in hook
t9112: add missing #!/bin/sh header
filter-branch: use $SHELL_PATH instead of 'sh'
filter-branch: don't use xargs -0
add NO_EXTERNAL_GREP build option
t6000lib: tr portability fix
t4020: don't use grep -a
add test_cmp function for test scripts
remove use of "tail -n 1" and "tail -1"
grep portability fix: don't use "-e" or "-q"
more tr portability test script fixes
t0050: perl portability fix
tr portability fixes
Once upon a time shortlog could be run from a non-git directory
and still do its job. Fix this regression and add a small test
for it.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Earlier, the callchain from pretty_print_commit() down to pp_title_line()
had an unwarranted assumption that the presense of "after_subject"
parameter, means the caller has already output MIME headers for
attachments. The parameter's primary purpose is to give extra header
lines the caller wants to place after pp_title_line() generates the
"Subject: " line.
This assumption does not hold when the user used the format.header
configuration variable to pass extra headers, and caused a message with
non-ASCII character to lack proper MIME headers (e.g. 8-bit CTE header).
The earlier logic also failed to suppress duplicated MIME headers when
"format-patch -s --attach" is asked for and the signer's name demanded
8-bit clean transport.
This patch fixes the logic by introducing a separate need_8bit_cte
parameter passed down the callchain. This can have one of these values:
-1 : we've already done MIME crap and we do not want to add extra header
to say this is 8bit in pp_title_line();
0 : we haven't done MIME and we have not seen anything that is 8bit yet;
1 : we haven't done MIME and we have seen something that is 8bit;
pp_title_line() must add MIME header.
It adds two tests by Jeff King who independently diagnosed this issue.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint:
Make man page building quiet when DOCBOOK_XSL_172 is defined
git-new-workdir: Share SVN meta data between work dirs and the repository
rev-parse: fix meaning of rev~ vs rev~0.
git-svn: don't blindly append '*' to branch/tags config
Tell xmlto to repress printing of the lines:
Note: meta date : No date. Using generated date git-xyx
Note: Writing git-xyz.1
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Multiple work dirs with git svn caused each work dir to have its own
stale copy of the SVN meta data in .git/svn
git svn rebase updates commits with git-svn-id: in the repository and
stores the SVN meta data information only in that work dir. Attempting to
git svn rebase in other work dirs for the same branch would fail because
the last revision fetched according to the git-svn-id is greater than the
revision in the SVN meta data for that work directory.
Signed-off-by: Bernt Hansen <bernt@norang.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
On Sat, 15 Mar 2008, SZEDER G?bor wrote:
>
> The testcase usually fails during the first 25 run, but sometimes it
> runs more than 100 times before failing.
Damn, this series has had more subtle issues than I ever expected.
'git stash' creates its saved working tree object with:
# state of the working tree
w_tree=$( (
rm -f "$TMP-index" &&
cp -p ${GIT_INDEX_FILE-"$GIT_DIR/index"} "$TMP-index" &&
GIT_INDEX_FILE="$TMP-index" &&
export GIT_INDEX_FILE &&
git read-tree -m $i_tree &&
git add -u &&
git write-tree &&
rm -f "$TMP-index"
) ) ||
die "Cannot save the current worktree state"
which creates a new index file with the updates, and writes the tree from
that.
We have this logic where we compare the timestamp of the index with the
timestamp of the files and we then write them out "smudged" if they are
the same, and it basically depends on the fact that the date on the index
file is compared with the date encoded in the stat information itself.
And what is going on is:
- we create a new index file with that "cp". We are careful to preserve
the timestamps by using "-p", so this one should be all ok.
- then we *update* that index by resetting it to the tree with git
read-tree, but now we do *not* preserve the timestamp on this new copy
any more, even though we copy over all the timestamps on the files that
are indexed from the stat information!
Now, we always had that problem when re-writing the index, but we had this
clever workaround in the writing part: if the source had racily clean
entries, then when we wrote those out (and thus can't depend on the index
fiel timestamp showing that they are racily clean any more!), we would
smudge them when writing.
IOW, we handle this issue by having write_index() do this:
for (i = 0; i < entries; i++) {
...
if (is_racy_timestamp(istate, ce))
ce_smudge_racily_clean_entry(ce);
..
when writing out entries. And that all took care of it, because now when
we wrote the new index, we'd change the timestamp on the index, yes, but
we'd smudge the entries we wrote out, so now the resulting index would
still show that file as not-up-to-date any more.
But with commit 34110cd4e3 ("Make
'unpack_trees()' have a separate source and destination index"), this
logic no longer triggers, because we now write out the "result" index, and
that one never got its timestamp updated from the source index, so it had
lost all that "is_racy_timestamp()" information!
This trivial patch fixes it. It looks trivial, and it's a simple fix, but
boy did it take me way too much thinking and explaining to myself to
explain why there was a problem in the first place!
The trivial fix is to just copy the index timestamp from the source index
into the result index. But we only do this if we *have* a source index, of
course, and if we will even bother to use the result.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
I updated Japanese translation for the latest git-gui.
Signed-off-by: しらいしななこ <nanako3@bluebottle.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Peter Karlsson pointed out there is no value in translating the
string "Apple", as this is used as the dummy label for the Apple
menu on Mac OS X systems.
The Apple menu is actually not the menu with the Apple corporate
logo, but the menu next to it, which shows the name of the
application and is typically called the application menu. Most users
of git-gui see this menu titled as "Git Gui". The actual label of
this menu comes from our Info.plist file and cannot be specified
by any other means. Translating this string in the Tcl PO files
is not necessary.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
I think it would make more sense for rev~ to have the same guarantees that
rev^ has, namely to always return a commit. I would also suggest that not
giving a number would have the same effect of defaulting to 1, not 0.
Right now it's a bit illogical, but at least it's an _undocumented_
illogical behaviour.
This patch makes '^' and '~' act the same for the default count (i.e. both
default to 1), and also have the same behaviour for a count of zero.
Before (no discernible pattern):
[torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~
45354a57ee7e3e42c7137db6c94fa968c6babe8d
89815cab95
45354a57ee7e3e42c7137db6c94fa968c6babe8d
045f5759c9
45354a57ee7e3e42c7137db6c94fa968c6babe8d
After (fairly logical):
[torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~
45354a57ee7e3e42c7137db6c94fa968c6babe8d
89815cab9589815cab95045f5759c9045f5759c9
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previously, git-svn would blindly append '*' even if it was specified by
the user during initialization (for certain SVN setups, it is
necessary).
Now, the following command will work correctly:
git svn init -T trunk/docutils \
-t 'tags/*/docutils' \
-b 'branches/*/docutils' \
svn://svn.berlios.de/docutils
Thanks to martin f krafft for the bug report:
> My git-svn target configuration is
>
> [svn-remote "svn"]
> url = svn://svn.berlios.de/docutils
> fetch = trunk/docutils:refs/remotes/trunk
> branches = branches/*/docutils:refs/remotes/*
> tags = tags/*/docutils:refs/remotes/tags/*
>
> Unfortunately, when I run
>
> git-svn init -T trunk/docutils -t 'tags/*/docutils'
> -b 'branches/*/docutils'
>
> then I get (note the two asterisks on the left hand side):
>
> branches = branches/*/docutils/*:refs/remotes/*
> tags = tags/*/docutils/*:refs/remotes/tags/*
>
> I took a brief stab at the code but I can't even figure out where
> the /* is appended, so I defer to you.
>
> It should be trivial to keep git-svn from appending /* if the left
> side already contains an asterisk.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Tested-by: martin f krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
It seems that some implementations of tr don't like a
replacement string of '-----...'; they try to find the
double-dash option "---...".
Instead of this pipeline of tr and sed invocations, just use a
single perl invocation.
Signed-off-by: Jeff King <peff@peff.net>
* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: initial Italian translation
gitk: Default to using po2msg.sh if msgfmt doesn't grok --tcl, -l and -d
gitk: Avoid Tcl error when switching views
[PATCH] gitk: Don't show local changes when we there is no work tree
[PATCH] gitk: Add horizontal scrollbar to the diff view
[PATCH] gitk: make autoselect optional
[PATCH] gitk: Mark another string for translation
[PATCH] Add an --argscmd flag to get the list of refs to show
gitk: Only restore window size from ~/.gitk, not position
This is a similar change to that submitted by Junio C Hamano for
git-gui. It tests whether the msgfmt command can be run successfully
with --tcl, -l and -d, and if not, falls back to using po/po2msg.sh.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Now we can generate diff to a file descriptor, we do not have to
dup() the stdout around when writing the status output.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Currently "git web--browse" is restricted to a set of commands defined
in the script. You can subvert the "browser.<tool>.path" to force "git
web--browse" to use a different command, but if you have a command
whose invocation syntax does not match one of the current tools then
you would have to write a wrapper script for it.
This patch adds a git config variable "browser.<tool>.cmd" which
allows a more flexible browser choice.
If you run "git web--browse" with -t/--tool, -b/--browser or the
"web.browser" config variable set to an unrecognized tool then "git
web--browse" will query the "browser.<tool>.cmd" config variable. If
this variable exists, then "git web--browse" will treat the specified
tool as a custom command and will use a shell eval to run the command
with the URLs added as extra parameters.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint:
merge-file: handle empty files gracefully
merge-recursive: handle file mode changes
Minor wording changes in the keyboard descriptions in git-add --interactive.
git fetch: Take '-n' to mean '--no-tags'
quiltimport: fix misquoting of parsed -p<num> parameter
git-quiltimport: better parser to grok "enhanced" series files.
read-tree -m can read up to MAX_TREES, which was arbitrarily set to 8 since
August 2007 (4 is needed to deal with 2 merge-base case).
However, the updated unpack_trees() code had an advertised limit of 4
(which it enforced). In reality the code was prepared to take only 3
trees and giving 4 caused it to stomp on its stack. Rename the MAX_TREES
constant to MAX_UNPACK_TREES, move it to the unpack-trees.h common header
file, and use it from both places to avoid future confusion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Earlier, it would error out while trying to read and/or writing them.
Now, calling merge-file with empty files is neither interesting nor
useful, but it is a bug that needed fixing.
Noticed by Clemens Buchacher.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
File mode changes should be handled similarly to changes of content.
That is, if the file mode changed in only one branch, keep the changed
version, and if both branch changed to different mode, mark it as a
conflict.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Runtime pack access is done in the pack file mtime order since recent
packs are more likely to contain frequently used objects than old packs.
However the --max-pack-size option can produce multiple packs with mtime
in the reversed order as newer objects are always written first.
Let's modify mtime of later pack files (when any) so they appear older
than preceding ones when a repack creates multiple packs.
Signed-off-by: Nicolas Pitre <nico@cam.org>
The wording of the interactive help text from git-add--interactive.perl is
clearer. Just duplicate that text here.
Signed-off-by: Vineet Kumar <vineet@doorstop.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The hook doesn't run properly under Solaris /bin/sh. Let's
use the SHELL_PATH the user told us about already instead.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
On some systems, 'sh' isn't very friendly. In particular,
t7003 fails on Solaris because it doesn't understand $().
Instead, use the specified SHELL_PATH to run shell code.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Some versions of xargs don't understand "-0"; fortunately in
this case we can get the same effect by using "git clean".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previously, we just chose whether to allow external grep
based on the __unix__ define. However, there are systems
which define this macro but which have an inferior group
(e.g., one that does not support all options used by t7002).
This allows users to accept the potential speed penalty to
get a more consistent grep experience (and to pass the
testsuite).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Some versions of tr complain if the number of characters in
both sets isn't the same. So here we must manually expand
the dashes in set2.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Solaris /usr/bin/grep doesn't understand "-a". In this case
we can just include the expected output with the test, which
is a better test anyway.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Many scripts compare actual and expected output using
"diff -u". This is nicer than "cmp" because the output shows
how the two differ. However, not all versions of diff
understand -u, leading to unnecessary test failure.
This adds a test_cmp function to the test scripts and
switches all "diff -u" invocations to use it. The function
uses the contents of "$GIT_TEST_CMP" to compare its
arguments; the default is "diff -u".
On systems with a less-capable diff, you can do:
GIT_TEST_CMP=cmp make test
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The "-n" syntax is not supported by System V versions of
tail (which prefer "tail -1"). Unfortunately "tail -1" is
not actually POSIX. We had some of both forms in our
scripts.
Since neither form works everywhere, this patch replaces
both with the equivalent sed invocation:
sed -ne '$p'
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>