]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
16 years agofilter-branch: use $SHELL_PATH instead of 'sh'
Jeff King [Wed, 12 Mar 2008 21:41:39 +0000 (17:41 -0400)] 
filter-branch: use $SHELL_PATH instead of 'sh'

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>
16 years agofilter-branch: don't use xargs -0
Jeff King [Wed, 12 Mar 2008 21:41:02 +0000 (17:41 -0400)] 
filter-branch: don't use xargs -0

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>
16 years agoadd NO_EXTERNAL_GREP build option
Jeff King [Wed, 12 Mar 2008 21:39:16 +0000 (17:39 -0400)] 
add NO_EXTERNAL_GREP build option

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>
16 years agot6000lib: tr portability fix
Jeff King [Wed, 12 Mar 2008 21:38:31 +0000 (17:38 -0400)] 
t6000lib: tr portability fix

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>
16 years agot4020: don't use grep -a
Jeff King [Wed, 12 Mar 2008 21:37:37 +0000 (17:37 -0400)] 
t4020: don't use grep -a

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>
16 years agoadd test_cmp function for test scripts
Jeff King [Wed, 12 Mar 2008 21:36:36 +0000 (17:36 -0400)] 
add test_cmp function for test scripts

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>
16 years agoremove use of "tail -n 1" and "tail -1"
Jeff King [Wed, 12 Mar 2008 21:34:34 +0000 (17:34 -0400)] 
remove use of "tail -n 1" and "tail -1"

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>
16 years agogrep portability fix: don't use "-e" or "-q"
Jeff King [Wed, 12 Mar 2008 21:32:17 +0000 (17:32 -0400)] 
grep portability fix: don't use "-e" or "-q"

System V versions of grep (such as Solaris /usr/bin/grep)
don't understand either of these options. git's usage of
"grep -e pattern" fell into one of two categories:

 1. equivalent to "grep pattern". -e is only useful here if
    the pattern begins with a "-", but all of the patterns
    are hardcoded and do not begin with a dash.

 2. stripping comments and blank lines with

      grep -v -e "^$" -e "^#"

    We can fortunately do this in the affirmative as

      grep '^[^#]'

Uses of "-q" can be replaced with redirection to /dev/null.
In many tests, however, "grep -q" is used as "if this string
is in the expected output, we are OK". In this case, it is
fine to just remove the "-q" entirely; it simply makes the
"verbose" mode of the test slightly more verbose.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomore tr portability test script fixes
Jeff King [Wed, 12 Mar 2008 21:31:06 +0000 (17:31 -0400)] 
more tr portability test script fixes

Dealing with NULs is not always safe with tr. On Solaris,
incoming NULs are silently deleted by both the System V and
UCB versions of tr. When converting to NULs, the System V
version works fine, but the UCB version silently ignores the
request to convert the character.

This patch changes all instances of tr using NULs to use
"perl -pe 'y///'" instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot0050: perl portability fix
Jeff King [Wed, 12 Mar 2008 21:30:10 +0000 (17:30 -0400)] 
t0050: perl portability fix

Older versions of perl (such as 5.005) don't understand -CO, nor
do they understand the "U" pack specifier. Instead of using perl,
let's just printf the binary bytes we are interested in.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotr portability fixes
Jeff King [Wed, 12 Mar 2008 21:29:57 +0000 (17:29 -0400)] 
tr portability fixes

Specifying character ranges in tr differs between System V
and POSIX. In System V, brackets are required (e.g.,
'[A-Z]'), whereas in POSIX they are not.

We can mostly get around this by just using the bracket form
for both sets, as in:

  tr '[A-Z] '[a-z]'

in which case POSIX interpets this as "'[' becomes '['",
which is OK.

However, this doesn't work with multiple sequences, like:

  # rot13
  tr '[A-Z][a-z]' '[N-Z][A-M][n-z][a-m]'

where the POSIX version does not behave the same as the
System V version. In this case, we must simply enumerate the
sequence.

This patch fixes problematic uses of tr in git scripts and
test scripts in one of three ways:

  - if a single sequence, make sure it uses brackets
  - if multiple sequences, enumerate
  - if extra brackets (e.g., tr '[A]' 'a'), eliminate
    brackets

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Wed, 12 Mar 2008 05:59:35 +0000 (22:59 -0700)] 
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: Simplify MSGFMT setting in Makefile
  git-gui: Add option for changing the width of the commit message text box
  git-gui: if a background colour is set, set foreground colour as well
  git-gui: translate the remaining messages in zh_cn.po to chinese

16 years agogit-gui: Simplify MSGFMT setting in Makefile
Junio C Hamano [Wed, 12 Mar 2008 05:29:52 +0000 (22:29 -0700)] 
git-gui: Simplify MSGFMT setting in Makefile

To prepare msg files for Tcl scripts, the command that is set to MSGFMT
make variable needs to be able to grok "--tcl -l <lang> -d <here>" options
correctly.  This patch simplifies the tests done in git-gui's Makefile to
directly test this condition.  If the test run does not exit properly with
zero status (either because you do not have "msgfmt" itself, or your
"msgfmt" is too old to grok --tcl option --- the reason does not matter),
have it fall back to po/po2msg.sh

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMerge branch 'js/remote'
Junio C Hamano [Wed, 12 Mar 2008 05:33:51 +0000 (22:33 -0700)] 
Merge branch 'js/remote'

* js/remote:
  "remote update": print remote name being fetched from
  builtin remote rm: remove symbolic refs, too
  remote: fix "update [group...]"
  remote show: Clean up connection correctly if object fetch wasn't done
  builtin-remote: prune remotes correctly that were added with --mirror
  Make git-remote a builtin
  Test "git remote show" and "git remote prune"
  parseopt: add flag to stop on first non option
  path-list: add functions to work with unsorted lists

Conflicts:

parse-options.c

16 years agoMerge branch 'lt/unpack-trees'
Junio C Hamano [Wed, 12 Mar 2008 05:13:44 +0000 (22:13 -0700)] 
Merge branch 'lt/unpack-trees'

* lt/unpack-trees:
  unpack_trees(): fix diff-index regression.
  traverse_trees_recursive(): propagate merge errors up
  unpack_trees(): minor memory leak fix in unused destination index
  Make 'unpack_trees()' have a separate source and destination index
  Make 'unpack_trees()' take the index to work on as an argument
  Add 'const' where appropriate to index handling functions
  Fix tree-walking compare_entry() in the presense of --prefix
  Move 'unpack_trees()' over to 'traverse_trees()' interface
  Make 'traverse_trees()' traverse conflicting DF entries in parallel
  Add return value to 'traverse_tree()' callback
  Make 'traverse_tree()' use linked structure rather than 'const char *base'
  Add 'df_name_compare()' helper function

16 years ago"remote update": print remote name being fetched from
Samuel Tardieu [Sun, 9 Mar 2008 12:37:55 +0000 (13:37 +0100)] 
"remote update": print remote name being fetched from

When the other end has dangling symref, "git fetch" issues an error
message but that is not grave enough to cause the fetch process to fail.
As the result, the user will see something like this:

    $ git remote update
    error: refs/heads/2.0-uobjects points nowhere!

"remote update" used to report which remote it is fetching from, like
this:

    $ git remote update
    Updating core
    Updating matthieu
    error: refs/heads/2.0-uobjects points nowhere!
    Updating origin

This reinstates the message "Updating <name>" in "git remote update".

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 12 Mar 2008 04:40:47 +0000 (21:40 -0700)] 
Merge branch 'maint'

* maint:
  git-svn: fix find-rev error message when missing arg
  t0021: tr portability fix for Solaris
  launch_editor(): allow spaces in the filename
  git rebase --abort: always restore the right commit

16 years agogit-svn: fix find-rev error message when missing arg
Marc-Andre Lureau [Tue, 11 Mar 2008 08:00:45 +0000 (10:00 +0200)] 
git-svn: fix find-rev error message when missing arg

Just let the user know that a revision argument is missing instead of
a perl error. This error message mimic the "init" error message, but
could be improved.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot0021: tr portability fix for Solaris
Jeff King [Tue, 11 Mar 2008 17:40:45 +0000 (13:40 -0400)] 
t0021: tr portability fix for Solaris

Solaris' /usr/bin/tr doesn't seem to like multiple character
ranges in brackets (it simply prints "Bad string").

Instead, let's just enumerate the transformation we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolaunch_editor(): allow spaces in the filename
Johannes Schindelin [Tue, 11 Mar 2008 09:56:30 +0000 (10:56 +0100)] 
launch_editor(): allow spaces in the filename

The construct

sh -c "$0 \"$@\"" <editor> <file>

does not pick up quotes in <editor>, so you cannot give path to the
editor that has a shell IFS whitespace in it, and also give it initial
set of parameters and flags.  Replace $0 with <editor> to fix this issue.

This fixes

git config core.editor '"c:/Program Files/What/Ever.exe"'

In other words, you can specify an editor with spaces in its path using a
config containing something like this:

[core]
editor = \"c:/Program Files/Darn/Spaces.exe\"

NOTE: we cannot just replace the $0 with \"$0\", because we still want
this to work:

[core]
editor = emacs -nw

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit rebase --abort: always restore the right commit
Mike Hommey [Sat, 1 Mar 2008 10:32:14 +0000 (11:32 +0100)] 
git rebase --abort: always restore the right commit

Previously, --abort would end by git resetting to ORIG_HEAD, but some
commands, such as git reset --hard (which happened in git rebase --skip,
but could just as well be typed by the user), would have already modified
ORIG_HEAD.

Just use the orig-head we store in $dotest instead.

[jc: cherry-picked from 48411d and 4947cf9 on 'master']

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jc/cherry-pick' (early part)
Junio C Hamano [Tue, 11 Mar 2008 09:05:12 +0000 (02:05 -0700)] 
Merge branch 'jc/cherry-pick' (early part)

* 'jc/cherry-pick' (early part):
  expose a helper function peel_to_type().
  merge-recursive: split low-level merge functions out.

Conflicts:

Makefile
builtin-merge-recursive.c
sha1_name.c

16 years agoMerge branch 'maint'
Junio C Hamano [Tue, 11 Mar 2008 08:54:46 +0000 (01:54 -0700)] 
Merge branch 'maint'

* maint:
  git-pull documentation: warn about the option order

16 years agoMerge branch 'kb/maint-filter-branch-disappear' into maint
Junio C Hamano [Tue, 11 Mar 2008 07:38:29 +0000 (00:38 -0700)] 
Merge branch 'kb/maint-filter-branch-disappear' into maint

* kb/maint-filter-branch-disappear:
  filter-branch: handle "disappearing tree" case correctly in subdir filter

16 years agoMerge branch 'aw/maint-shortlog-blank-lines' into maint
Junio C Hamano [Tue, 11 Mar 2008 07:37:38 +0000 (00:37 -0700)] 
Merge branch 'aw/maint-shortlog-blank-lines' into maint

* aw/maint-shortlog-blank-lines:
  shortlog: take the first populated line of the description

16 years agounpack_trees(): fix diff-index regression.
Linus Torvalds [Tue, 11 Mar 2008 06:51:13 +0000 (23:51 -0700)] 
unpack_trees(): fix diff-index regression.

When skip_unmerged option is not given, unpack_trees() should not just
skip unmerged cache entries but keep them in the result for the caller to
sort them out.

For callers other than diff-index, the incoming index should never be
unmerged, but diff-index is a special case caller.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoupdate 'git rebase' documentation
SZEDER Gábor [Mon, 10 Mar 2008 14:38:33 +0000 (15:38 +0100)] 
update 'git rebase' documentation

Being in the project's top directory when starting or continuing a rebase
is not necessary since 533b703 (Allow whole-tree operations to be started
from a subdirectory, 2007-01-12).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash: fix long option with argument double completion
SZEDER Gábor [Wed, 5 Mar 2008 19:07:49 +0000 (20:07 +0100)] 
bash: fix long option with argument double completion

Pressing TAB right after 'git command --long-option=' results in
'git command --long-option=--long-option=' when the long option requires
an argument, but we don't provide completion for its arguments (e.g.
commit --author=, apply --exclude=).  This patch detects these long
options and provides empty completion array for them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: Add more long options to be completed with "git --<TAB>"
Teemu Likonen [Thu, 6 Mar 2008 16:52:37 +0000 (18:52 +0200)] 
bash: Add more long options to be completed with "git --<TAB>"

Add the following long options to be completed with command "git":

--paginate
--work-tree=
--help

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: use __gitdir when completing 'git rebase' options
SZEDER Gábor [Thu, 6 Mar 2008 21:37:36 +0000 (22:37 +0100)] 
bash: use __gitdir when completing 'git rebase' options

When doing completion of rebase options in a subdirectory of the work
tree during an ongoing rebase, wrong options were offered because of the
hardcoded .git/.dotest-merge path.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: Remove completion of core.legacyheaders option
Shawn O. Pearce [Mon, 10 Mar 2008 23:49:19 +0000 (19:49 -0400)] 
bash: Remove completion of core.legacyheaders option

This option is no longer recognized by git.  Completing it is
not worthwhile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: add 'git svn' subcommands and options
SZEDER Gábor [Mon, 10 Mar 2008 15:02:25 +0000 (16:02 +0100)] 
bash: add 'git svn' subcommands and options

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: add new 'git stash' subcommands
SZEDER Gábor [Mon, 10 Mar 2008 15:02:24 +0000 (16:02 +0100)] 
bash: add new 'git stash' subcommands

Namely 'save', 'drop', 'pop' and 'create'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: refactor searching for subcommands on the command line
SZEDER Gábor [Mon, 10 Mar 2008 15:02:23 +0000 (16:02 +0100)] 
bash: refactor searching for subcommands on the command line

This patch adds the __git_find_subcommand function, which takes one
argument: a string containing all subcommands separated by spaces.  The
function searches through the command line whether a subcommand is
already present.  The first found subcommand will be printed to standard
output.

This enables us to remove code duplications from completion functions
for commands having subcommands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: remove unnecessary conditions when checking for subcommands
SZEDER Gábor [Mon, 10 Mar 2008 15:02:22 +0000 (16:02 +0100)] 
bash: remove unnecessary conditions when checking for subcommands

Checking emptyness of $command is sufficient.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agobash: Properly quote the GIT_DIR at all times to fix subdirectory paths with spaces
Kevin Ballard [Sun, 9 Mar 2008 03:10:48 +0000 (22:10 -0500)] 
bash: Properly quote the GIT_DIR at all times to fix subdirectory paths with spaces

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agotraverse_trees_recursive(): propagate merge errors up
Junio C Hamano [Mon, 10 Mar 2008 08:26:23 +0000 (01:26 -0700)] 
traverse_trees_recursive(): propagate merge errors up

There were few places where merge errors detected deeper in the call chain
were ignored and not propagated up the callchain to the caller.

Most notably, this caused switching branches with "git checkout" to ignore
a path modified in a work tree are different between the HEAD version and
the commit being switched to, which it internally notices but ignores it,
resulting in an incorrect two-way merge and loss of the change in the work
tree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-pull documentation: warn about the option order
Junio C Hamano [Mon, 10 Mar 2008 08:22:03 +0000 (01:22 -0700)] 
git-pull documentation: warn about the option order

We might eventually be loosening this rule, but there is a longstanding
restriction that the users currently need to be aware of.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agounpack_trees(): minor memory leak fix in unused destination index
Linus Torvalds [Fri, 7 Mar 2008 21:48:40 +0000 (13:48 -0800)] 
unpack_trees(): minor memory leak fix in unused destination index

This adds a "discard_index(&o->result)" to the failure path, to reclaim
memory from an in-core index we built but ended up not using.

The *big* memory leak comes from the fact that we leak the cache_entry
things left and right. That's a very traditional and deliberate leak:
because we used to build up the cache entries by just mapping them
directly in from the index file (and we emulate that in modern times
by allocating them from one big array), we can't actually free them
one-by-one.

So doing the "discard_index()" will free the hash tables etc, which is
good, and it will free the "istate->alloc" but that is never set on the
result because we don't get the result from the index read. So we don't
actually free the individual cache entries themselves that got created
from the trees.

That's not something new, btw. We never did. But some day we should just
add a flag to the cache_entry() that it's a "free one by one" kind, and
then we could/should do it. In the meantime, this one-liner will fix
*some* of the memory leaks, but not that old traditional one.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake 'unpack_trees()' have a separate source and destination index
Linus Torvalds [Fri, 7 Mar 2008 02:12:28 +0000 (18:12 -0800)] 
Make 'unpack_trees()' have a separate source and destination index

We will always unpack into our own internal index, but we will take the
source from wherever specified, and we will optionally write the result
to a specified index (optionally, because not everybody even _wants_ any
result: the index diffing really wants to just walk the tree and index
in parallel).

This ends up removing a fair number more lines than it adds, for the
simple reason that we can now skip all the crud that tried to be
oh-so-careful about maintaining our position in the index as we were
traversing and modifying it.  Since we don't actually modify the source
index any more, we can just update the 'o->pos' pointer without worrying
about whether an index entry got removed or replaced or added to.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake 'unpack_trees()' take the index to work on as an argument
Linus Torvalds [Thu, 6 Mar 2008 20:26:14 +0000 (12:26 -0800)] 
Make 'unpack_trees()' take the index to work on as an argument

This is just a very mechanical conversion, and makes everybody set it to
'&the_index' before calling, but at least it makes it more explicit
where we work with the index.

The next stage would be to split that index usage up into a 'source' and
a 'destination' index, so that we can unpack into a different index than
we started out from.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd 'const' where appropriate to index handling functions
Linus Torvalds [Thu, 6 Mar 2008 20:46:09 +0000 (12:46 -0800)] 
Add 'const' where appropriate to index handling functions

This is in an effort to make the source index of 'unpack_trees()' as
being const, and thus making the compiler help us verify that we only
access it for reading.

The constification also extended to some of the hashing helpers that get
called indirectly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix tree-walking compare_entry() in the presense of --prefix
Linus Torvalds [Thu, 6 Mar 2008 23:44:48 +0000 (15:44 -0800)] 
Fix tree-walking compare_entry() in the presense of --prefix

When we make the "root" tree-walk info entry have a pathname in it, we
need to have a ->prev pointer so that compare_entry will actually notice
and traverse into the root.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMove 'unpack_trees()' over to 'traverse_trees()' interface
Linus Torvalds [Thu, 6 Mar 2008 04:15:44 +0000 (20:15 -0800)] 
Move 'unpack_trees()' over to 'traverse_trees()' interface

This not only deletes more code than it adds, it gets rid of a
singularly hard-to-understand function (unpack_trees_rec()), and
replaces it with a set of smaller and simpler functions that use the
generic tree traversal mechanism to walk over one or more git trees in
parallel.

It's still not the most wonderful interface, and by no means is the new
code easy to understand either, but it's at least a bit less opaque.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake 'traverse_trees()' traverse conflicting DF entries in parallel
Linus Torvalds [Thu, 6 Mar 2008 04:06:18 +0000 (20:06 -0800)] 
Make 'traverse_trees()' traverse conflicting DF entries in parallel

This makes the traverse_trees() entry comparator routine use the more
relaxed form of name comparison that considers files and directories
with the same name identical.

We pass in a separate mask for just the directory entries, so that the
callback routine can decide (if it wants to) to only handle one or the
other type, but generally most (all?) users are expected to really want
to see the case of a name 'foo' showing up in one tree as a file and in
another as a directory at the same time.

In particular, moving 'unpack_trees()' over to use this tree traversal
mechanism requires this.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd return value to 'traverse_tree()' callback
Linus Torvalds [Thu, 6 Mar 2008 03:44:06 +0000 (19:44 -0800)] 
Add return value to 'traverse_tree()' callback

This allows the callback to return an error value, but it can also
specify which of the tree entries that it actually used up by returning
a positive mask value.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake 'traverse_tree()' use linked structure rather than 'const char *base'
Linus Torvalds [Thu, 6 Mar 2008 02:59:29 +0000 (18:59 -0800)] 
Make 'traverse_tree()' use linked structure rather than 'const char *base'

This makes the calling convention a bit less obvious, but a lot more
flexible.  Instead of allocating and extending a new 'base' string, we
just link the top-most name into a linked list of the 'info' structure
when traversing a subdirectory, and we can generate the basename by
following the list.

Perhaps even more importantly, the linked list of info structures also
gives us a place to naturally save off other information than just the
directory name.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd 'df_name_compare()' helper function
Linus Torvalds [Thu, 6 Mar 2008 02:25:10 +0000 (18:25 -0800)] 
Add 'df_name_compare()' helper function

This new helper is identical to base_name_compare(), except it compares
conflicting directory/file entries as equal in order to help handling DF
conflicts (thus the name).

Note that while a directory name compares as equal to a regular file
with the new helper, they then individually compare _differently_ to a
filename that has a dot after the basename (because '\0' < '.' < '/').

So a directory called "foo/" will compare equal to a file "foo", even
though "foo.c" will compare after "foo" and before "foo/"

This will be used by routines that want to traverse the git namespace
but then handle conflicting entries together when possible.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin remote rm: remove symbolic refs, too
Johannes Schindelin [Sat, 8 Mar 2008 22:40:42 +0000 (23:40 +0100)] 
builtin remote rm: remove symbolic refs, too

"git remote add" can add a symbolic ref "HEAD", and "rm" should delete
it, too.

Noticed by Teemu Likonen.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd a test for read-tree -u --reset with a D/F conflict
Jeff King [Sun, 9 Mar 2008 04:27:04 +0000 (20:27 -0800)] 
Add a test for read-tree -u --reset with a D/F conflict

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ph/parseopt'
Junio C Hamano [Sun, 9 Mar 2008 05:29:59 +0000 (21:29 -0800)] 
Merge branch 'ph/parseopt'

* ph/parseopt:
  parse-options: new option type to treat an option-like parameter as an argument.
  parse-opt: bring PARSE_OPT_HIDDEN and NONEG to git-rev-parse --parseopt

16 years agoMerge branch 'dp/clean-fix'
Junio C Hamano [Sun, 9 Mar 2008 05:29:56 +0000 (21:29 -0800)] 
Merge branch 'dp/clean-fix'

* dp/clean-fix:
  git-clean: add tests for relative path
  git-clean: correct printing relative path
  Make private quote_path() in wt-status.c available as quote_path_relative()
  Revert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec())
  Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)
  Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)
  get_pathspec(): die when an out-of-tree path is given

16 years agoMerge branch 'ml/submodule-add-existing'
Junio C Hamano [Sun, 9 Mar 2008 05:29:52 +0000 (21:29 -0800)] 
Merge branch 'ml/submodule-add-existing'

* ml/submodule-add-existing:
  git-submodule - Allow adding a submodule in-place

16 years agoMerge branch 'mr/compat-snprintf'
Junio C Hamano [Sun, 9 Mar 2008 05:29:50 +0000 (21:29 -0800)] 
Merge branch 'mr/compat-snprintf'

* mr/compat-snprintf:
  Add compat/snprintf.c for systems that return bogus

16 years agoMerge branch 'sp/fetch-optim'
Junio C Hamano [Sun, 9 Mar 2008 04:11:35 +0000 (20:11 -0800)] 
Merge branch 'sp/fetch-optim'

* sp/fetch-optim:
  Teach git-fetch to exploit server side automatic tag following
  Teach fetch-pack/upload-pack about --include-tag
  git-pack-objects: Automatically pack annotated tags if object was packed
  Teach git-fetch to grab a tag at the same time as a commit
  Make git-fetch follow tags we already have objects for sooner
  Teach upload-pack to log the received need lines to an fd
  Free the path_lists used to find non-local tags in git-fetch
  Allow builtin-fetch's find_non_local_tags to append onto a list
  Ensure tail pointer gets setup correctly when we fetch HEAD only
  Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch
  Remove unused variable in builtin-fetch find_non_local_tags

16 years agoMerge branch 'jc/describe-always'
Junio C Hamano [Sun, 9 Mar 2008 04:10:09 +0000 (20:10 -0800)] 
Merge branch 'jc/describe-always'

* jc/describe-always:
  describe --always: fall back to showing an abbreviated object name

16 years agoMerge branch 'jc/am'
Junio C Hamano [Sun, 9 Mar 2008 04:10:05 +0000 (20:10 -0800)] 
Merge branch 'jc/am'

* jc/am:
  am: --rebasing
  am: remove support for -d .dotest
  am: read from the right mailbox when started from a subdirectory

16 years agoMerge branch 'cr/reset-parseopt'
Junio C Hamano [Sun, 9 Mar 2008 04:09:55 +0000 (20:09 -0800)] 
Merge branch 'cr/reset-parseopt'

* cr/reset-parseopt:
  Make builtin-reset.c use parse_options.

16 years agoMerge branch 'jn/gitweb-pickaxe'
Junio C Hamano [Sun, 9 Mar 2008 04:09:51 +0000 (20:09 -0800)] 
Merge branch 'jn/gitweb-pickaxe'

* jn/gitweb-pickaxe:
  gitweb: Fix and simplify pickaxe search

16 years agoMerge branch 'kb/maint-filter-branch-disappear'
Junio C Hamano [Sun, 9 Mar 2008 04:09:13 +0000 (20:09 -0800)] 
Merge branch 'kb/maint-filter-branch-disappear'

* kb/maint-filter-branch-disappear:
  filter-branch: handle "disappearing tree" case correctly in subdir filter

16 years agoMerge branch 'maint' to sync with 1.5.4.4
Junio C Hamano [Sun, 9 Mar 2008 04:07:49 +0000 (20:07 -0800)] 
Merge branch 'maint' to sync with 1.5.4.4

* maint:
  GIT 1.5.4.4
  ident.c: reword error message when the user name cannot be determined
  Fix dcommit, rebase when rewriteRoot is in use
  Really make the LF after reset in fast-import optional

16 years agoGIT 1.5.4.4 v1.5.4.4
Junio C Hamano [Sun, 9 Mar 2008 03:34:47 +0000 (19:34 -0800)] 
GIT 1.5.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoident.c: reword error message when the user name cannot be determined
Santi Béjar [Sat, 8 Mar 2008 11:30:04 +0000 (12:30 +0100)] 
ident.c: reword error message when the user name cannot be determined

The "config --global" suggested in the message is a valid one-shot fix,
and hopefully one-shot across machines that NFS mounts the home directories.

This knowledge can hopefully be reused when you are forced to use git on
Windows, but the fix based on GECOS would not be applicable, so
it is not such a useful hint to mention the exact reason why the
name cannot be determined.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix dcommit, rebase when rewriteRoot is in use
John Goerzen [Sat, 8 Mar 2008 22:04:05 +0000 (16:04 -0600)] 
Fix dcommit, rebase when rewriteRoot is in use

When the rewriteRoot setting is used with git-svn, it causes the svn
IDs added to commit messages to bear a different URL than is actually
used to retrieve Subversion data.

It is common for Subversion repositories to be available multiple
ways: for instance, HTTP to the public, and svn+ssh to people with
commit access.  The need to switch URLs for access is fairly common as
well -- perhaps someone was just given commit access.  To switch URLs
without having to rewrite history, one can use the old url as a
rewriteRoot, and use the new one in the svn-remote url setting.

This works well for svn fetching and general git commands.

However, git-svn dcommit, rebase, and perhaps other commands do not
work in this scenario.  They scan the svn ID lines in commit messages
and attempt to match them up with url lines in [svn-remote] sections
in the git config.

This patch allows them to match rewriteRoot options, if such options
are present.

Signed-off-by: John Goerzen <jgoerzen@complete.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agofilter-branch: handle "disappearing tree" case correctly in subdir filter
Junio C Hamano [Sat, 8 Mar 2008 20:25:58 +0000 (12:25 -0800)] 
filter-branch: handle "disappearing tree" case correctly in subdir filter

The subdirectory filter had a bug to notice that the commit in question
did not have anything in the path-limited part of the tree.  $commit:$path
does not name an empty tree when $path does not appear in $commit.

This should fix it.  The additional test in t7003 is originally from Kevin
Ballard but with fixups.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomerge-tool documentation: describe custom command usage
Charles Bailey [Sat, 8 Mar 2008 20:47:06 +0000 (20:47 +0000)] 
merge-tool documentation: describe custom command usage

The configuration variables for custom merge tools were documented
only in config.txt but there was no reference to the functionality in
git-mergetool.txt.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-mergetool documentaiton: show toolnames in typewriter font
Charles Bailey [Sat, 8 Mar 2008 20:46:34 +0000 (20:46 +0000)] 
git-mergetool documentaiton: show toolnames in typewriter font

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReally make the LF after reset in fast-import optional
Adeodato Simó [Fri, 7 Mar 2008 20:22:17 +0000 (21:22 +0100)] 
Really make the LF after reset in fast-import optional

cmd_from() ends with a call to read_next_command(), which is needed
when using cmd_from() from commands where from is not the last element.

With reset, however, "from" is the last command, after which the flow
returns to the main loop, which calls read_next_command() again.

Because of this, always set unread_command_buf in cmd_reset_branch(),
even if cmd_from() was successful.

Add a test case for this in t9300-fast-import.sh.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'aw/maint-shortlog-blank-lines'
Junio C Hamano [Sat, 8 Mar 2008 10:23:42 +0000 (02:23 -0800)] 
Merge branch 'aw/maint-shortlog-blank-lines'

* aw/maint-shortlog-blank-lines:
  shortlog: take the first populated line of the description

16 years agoMerge branch 'mh/maint-http-proxy-fix' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:20:37 +0000 (02:20 -0800)] 
Merge branch 'mh/maint-http-proxy-fix' into maint

* mh/maint-http-proxy-fix:
  Set proxy override with http_init()

16 years agoMerge branch 'js/maint-daemon' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:20:30 +0000 (02:20 -0800)] 
Merge branch 'js/maint-daemon' into maint

* js/maint-daemon:
  daemon: ensure that base-path is an existing directory
  daemon: send more error messages to the syslog

16 years agoMerge branch 'js/maint-cvsexport' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:13:52 +0000 (02:13 -0800)] 
Merge branch 'js/maint-cvsexport' into maint

* js/maint-cvsexport:
  cvsexportcommit: be graceful when "cvs status" reorders the arguments

Conflicts:

t/t9200-git-cvsexportcommit.sh

16 years agoMerge branch 'jc/maint-log-merge-left-right' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:11:37 +0000 (02:11 -0800)] 
Merge branch 'jc/maint-log-merge-left-right' into maint

* jc/maint-log-merge-left-right:
  Fix "git log --merge --left-right"

16 years agoMerge branch 'ew/maint-svn-cert-fileprovider' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:11:32 +0000 (02:11 -0800)] 
Merge branch 'ew/maint-svn-cert-fileprovider' into maint

* ew/maint-svn-cert-fileprovider:
  git-svn: Don't prompt for client cert password everytime.

16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 8 Mar 2008 06:43:46 +0000 (22:43 -0800)] 
Merge branch 'maint'

* maint:
  unquote_c_style: fix off-by-one.
  test-lib: fix TERM to dumb for test repeatability
  config.txt: refer to --upload-pack and --receive-pack instead of --exec
  git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails

16 years agosend-email: --no-signed-off-cc should suppress 'sob' cc
Junio C Hamano [Sat, 8 Mar 2008 06:12:13 +0000 (22:12 -0800)] 
send-email: --no-signed-off-cc should suppress 'sob' cc

The logic to countermand suppression of Cc to the signers with a more
explicit --signed-off-by option done in 6564828 (git-send-email:
Generalize auto-cc recipient mechanism) suffers from a double-negation
error.

A --signed-off-cc option, when false, should actively suppress CC: to be
generated out of S-o-b lines, and it should refrain from suppressing when
it is true.

It also fixes "(sob) Adding cc:" status output; earlier it included the
line terminator LF inside '%s', which was totally bogus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'js/reflog-delete'
Junio C Hamano [Sat, 8 Mar 2008 06:34:26 +0000 (22:34 -0800)] 
Merge branch 'js/reflog-delete'

* js/reflog-delete:
  t3903-stash.sh: Add tests for new stash commands drop and pop
  git-reflog.txt: Document new commands --updateref and --rewrite
  t3903-stash.sh: Add missing '&&' to body of testcase
  git-stash: add new 'pop' subcommand
  git-stash: add new 'drop' subcommand
  git-reflog: add option --updateref to write the last reflog sha1 into the ref
  refs.c: make close_ref() and commit_ref() non-static
  git-reflog: add option --rewrite to update reflog entries while expiring
  reflog-delete: parse standard reflog options
  builtin-reflog.c: fix typo that accesses an unset variable
  Teach "git reflog" a subcommand to delete single entries

16 years agoMerge branch 'dc/format-pretty'
Junio C Hamano [Sat, 8 Mar 2008 06:33:26 +0000 (22:33 -0800)] 
Merge branch 'dc/format-pretty'

* dc/format-pretty:
  log/show/whatchanged: introduce format.pretty configuration
  specify explicit "--pretty=medium" with `git log/show/whatchanged`
  whatchanged documentation: share description of --pretty with others

16 years agoMerge branch 'cb/mergetool'
Junio C Hamano [Sat, 8 Mar 2008 06:30:07 +0000 (22:30 -0800)] 
Merge branch 'cb/mergetool'

* cb/mergetool:
  Add a very basic test script for git mergetool
  Teach git mergetool to use custom commands defined at config time
  Changed an internal variable of mergetool to support custom commands
  Tidy up git mergetool's backup file behaviour

16 years agogit-clean: add tests for relative path
Junio C Hamano [Sat, 8 Mar 2008 05:56:56 +0000 (21:56 -0800)] 
git-clean: add tests for relative path

This adds tests for recent change by Dmitry to fix the report "git
clean" gives on removed paths, and also makes sure the command detects
paths that is outside working tree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-clean: correct printing relative path
Dmitry Potapov [Fri, 7 Mar 2008 01:13:17 +0000 (04:13 +0300)] 
git-clean: correct printing relative path

When the given path contains '..' then git-clean incorrectly printed names
of files. This patch changes cmd_clean to use quote_path_relative().
Also, "failed to remove ..." message used absolutely path, but not it is
corrected to use relative path.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake private quote_path() in wt-status.c available as quote_path_relative()
Dmitry Potapov [Fri, 7 Mar 2008 02:30:58 +0000 (05:30 +0300)] 
Make private quote_path() in wt-status.c available as quote_path_relative()

Move quote_path() from wt-status.c to quote.c and rename it as
quote_path_relative(), because it is a better name for a public function.

Also, instead of handcrafted quoting, quote_c_style_counted() is now used,
to make its quoting more consistent with the rest of the system, also
honoring core.quotepath specified in configuration.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Add option for changing the width of the commit message text box
Adam Piątyszek [Thu, 6 Mar 2008 19:38:40 +0000 (20:38 +0100)] 
git-gui: Add option for changing the width of the commit message text box

The width of the commit message text area is currently hard-coded
to 75 characters. This value might be not optimal for some projects.
For instance users who would like to generate GNU-style ChangeLog
file from git commit message might prefer commit messages of width
no longer than 70 characters.

This patch adds a global and per repository option "Commit Message
Text Width", which could be used to change the width of the commit
message text area.

Signed-off-by: Adam Piątyszek <ediap@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agounquote_c_style: fix off-by-one.
Pierre Habouzit [Thu, 6 Mar 2008 21:28:19 +0000 (22:28 +0100)] 
unquote_c_style: fix off-by-one.

The optional endp parameter to unquote_c_style() was supposed to point at
a location past the closing double quote, but it was going one beyond it.

git-fast-import used this function heavily and the bug caused it to
misparse the input stream, especially when parsing a rename command:

R "filename that needs quoting" rename-target-name

Because the function erroneously ate the whitespace after the closing dq,
this triggered "Missing space after source" error when it shouldn't.

Thanks to Adeodato Simò for having caught this.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotest-lib: fix TERM to dumb for test repeatability
Junio C Hamano [Fri, 7 Mar 2008 03:04:26 +0000 (19:04 -0800)] 
test-lib: fix TERM to dumb for test repeatability

Dscho noticed that Term::ReadLine (used by send-email) colorized its
output for his TERM settings, inside t9001 tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig.txt: refer to --upload-pack and --receive-pack instead of --exec
Uwe Kleine-König [Thu, 6 Mar 2008 20:28:07 +0000 (21:28 +0100)] 
config.txt: refer to --upload-pack and --receive-pack instead of --exec

The options --upload-pack (of git-fetch-pack) and --receive-pack (of
git-push) do the same as --exec (for both commands).  But the former options
have the more descriptive name.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ar/sgid-bsd'
Junio C Hamano [Fri, 7 Mar 2008 18:53:14 +0000 (10:53 -0800)] 
Merge branch 'ar/sgid-bsd'

* ar/sgid-bsd:
  Do not use GUID on dir in git init --shared=all on FreeBSD

16 years agoMerge branch 'cc/run-command'
Junio C Hamano [Fri, 7 Mar 2008 18:53:10 +0000 (10:53 -0800)] 
Merge branch 'cc/run-command'

* cc/run-command:
  run-command: Redirect stderr to a pipe before redirecting stdout to stderr

16 years agoRevert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec())
Junio C Hamano [Fri, 7 Mar 2008 07:50:51 +0000 (23:50 -0800)] 
Revert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec())

When get_pathspec() was originally made absolute-path capable,
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way.  This is made unnecessary with the previous patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRevert part of 1abf095 (git-add: adjust to the get_pathspec() changes)
Junio C Hamano [Fri, 7 Mar 2008 07:31:29 +0000 (23:31 -0800)] 
Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)

When get_pathspec() was originally made absolute-path capable,
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way.  This is made unnecessary with the previous patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRevert part of 744dacd (builtin-mv: minimum fix to avoid losing files)
Junio C Hamano [Fri, 7 Mar 2008 07:29:40 +0000 (23:29 -0800)] 
Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)

When get_pathspec() was originally made absolute-path capable,
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way.  This is made unnecessary with the previous patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoget_pathspec(): die when an out-of-tree path is given
Junio C Hamano [Fri, 7 Mar 2008 07:18:08 +0000 (23:18 -0800)] 
get_pathspec(): die when an out-of-tree path is given

An earlier commit d089ebaa (setup: sanitize absolute and funny paths) made
get_pathspec() aware of absolute paths, but with a botched interface that
forced the callers to count the resulting pathspecs in order to detect
an error of giving a path that is outside the work tree.

This fixes it, by dying inside the function.

We had ls-tree test that relied on a misfeature in the original
implementation of its pathspec handling.  Leading slashes were silently
removed from them.  However we allow giving absolute pathnames (people
want to cut and paste from elsewhere) that are inside work tree these
days, so a pathspec that begin with slash _should_ be treated as a full
path.  The test is adjusted to match the updated rule for get_pathspec().

Earlier I mistook three tests given by Robin that they should succeed, but
these are attempts to add path outside work tree, which should fail
loudly.  These tests also have been fixed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Thu, 6 Mar 2008 08:18:23 +0000 (00:18 -0800)] 
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails

16 years agogit-gui: if a background colour is set, set foreground colour as well
Philipp A. Hartmann [Wed, 5 Mar 2008 16:54:22 +0000 (17:54 +0100)] 
git-gui: if a background colour is set, set foreground colour as well

In several places, only the background colour is set to an explicit
value, sometimes even "white".  This does not work well with dark
colour themes.

This patch tries to set the foreground colour to "black" in those
situations, where an explicit background colour is set without defining
any foreground colour.

Signed-off-by: Philipp A. Hartmann <ph@sorgh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: translate the remaining messages in zh_cn.po to chinese
eric miao [Sun, 6 Jan 2008 09:47:05 +0000 (17:47 +0800)] 
git-gui: translate the remaining messages in zh_cn.po to chinese

'make' shows:
  MSGFMT po/zh_cn.msg 368 translated, 2 fuzzy, 1 untranslated message.

1. update the zh_cn.po and translate the remaining messages in chinese

2. correct some of the previously mis-translated messages

3. add a list of word interpretation in the head as a guideline for
   subsequent updatings and translations

Signed-off-by: eric miao <eric.miao@marvell.com>
Acked-by: Xudong Guan <xudong.guan@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogitweb: Fix and simplify pickaxe search
Jakub Narebski [Wed, 5 Mar 2008 08:31:55 +0000 (09:31 +0100)] 
gitweb: Fix and simplify pickaxe search

Instead of using "git-rev-list | git-diff-tree" pipeline for pickaxe
search, use git-log with appropriate options.  Besides reducing number
of forks by one, this allows to use list form of open, which in turn
allow to not worry about quoting arguments and to avoid forking shell.

The options to git-log were chosen to reduce required changes in
pickaxe git command output parsing; gitweb still parses returned
commits one by one.

Parsing "pickaxe" output is simplified: git_search now reuses
parse_difftree_raw_line and writes affected files as they arrive using
the fact that commit name goes always before [raw] diff.

While at it long bug of pickaxe search was fixed, namely that the last
commit found by pickaxe search was never shown.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-submodule - Allow adding a submodule in-place
Mark Levedahl [Wed, 5 Mar 2008 01:15:02 +0000 (20:15 -0500)] 
git-submodule - Allow adding a submodule in-place

When working in the top-level project, it is useful to create a new
submodule as a git repo in a subdirectory, then add that submodule to
the top-level in place.

This patch allows "git submodule add <intended url> subdir" to add the
existing subdir to the current project.  The presumption is the user will
later push / clone the subdir to the <intended url> so that future
submodule init / updates will work.

Absent this patch, "git submodule add" insists upon cloning the subdir
from a repository at the given url, which is fine for adding an existing
project in, but less useful when adding a new submodule from scratch to an
existing project.  The former functionality remains, and the clone is
attempted if the subdir does not already exist as a valid git repo.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoshortlog: take the first populated line of the description
Andy Whitcroft [Wed, 5 Mar 2008 14:24:10 +0000 (14:24 +0000)] 
shortlog: take the first populated line of the description

Way back the perl version of shortlog would take the first populated line
of the commit body.  The builtin version mearly takes the first line.
This leads to empty shortlog entries when there is some viable text in
the commit.

Reinstate this behaviour igoring all lines with nothing but whitespace.
This is often useful when dealing with commits imported from foreign SCMs
that do not tidy up the log message of useless blank lines at the beginning.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd compat/snprintf.c for systems that return bogus
Michal Rokos [Wed, 5 Mar 2008 15:46:13 +0000 (16:46 +0100)] 
Add compat/snprintf.c for systems that return bogus

Some systems (namely HPUX and Windows) return -1 when maxsize in snprintf()
and in vsnprintf() is reached. So replace snprintf() and vsnprintf()
functions with our own ones that return correct value upon overflow.

[jc: verified that review comments by J6t have been incorporated, and
 tightened the check to verify the resulting buffer contents, suggested
 by Wayne Davison]

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDo not use GUID on dir in git init --shared=all on FreeBSD
Alex Riesen [Tue, 4 Mar 2008 23:15:39 +0000 (00:15 +0100)] 
Do not use GUID on dir in git init --shared=all on FreeBSD

It does not allow changing the bit to a non-root user.
This fixes t1301-shared-repo.sh on the platform.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>