gitweb.git
transport-helper.c::push_refs(): ignore helper-reported... Tay Ray Chuan Fri, 8 Jan 2010 02:12:44 +0000 (10:12 +0800)

transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed

If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).

However, the remote helper may still act on these refs.

If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.

This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.

Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport.c::transport_push(): make ref status affect... Tay Ray Chuan Fri, 8 Jan 2010 02:12:43 +0000 (10:12 +0800)

transport.c::transport_push(): make ref status affect return value

Use push_had_errors() to check the refs for errors and modify the
return value.

Mark the non-fast-forward push tests to succeed.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor ref status logic for pushingTay Ray Chuan Fri, 8 Jan 2010 02:12:42 +0000 (10:12 +0800)

refactor ref status logic for pushing

Move the logic that detects up-to-date and non-fast-forward refs to a
new function in remote.[ch], set_ref_status_for_push().

Make transport_push() invoke set_ref_status_for_push() before invoking
the push_refs() implementation. (As a side-effect, the push_refs()
implementation in transport-helper.c now knows of non-fast-forward
pushes.)

Removed logic for detecting up-to-date refs from the push_refs()
implementation in transport-helper.c, as transport_push() has already
done so for it.

Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
send_pack(), as transport_push() can't do it for send_pack() here.

Mark the test on the return status of non-fast-forward push to fail.
Git now exits with success, as transport.c::transport_push() does not
check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
indicate rejected pushes with its return value.

Mark the test for ref status to succeed. As mentioned earlier, refs
might be marked as non-fast-forwards, triggering the push status
printing mechanism in transport.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5541-http-push.sh: add test for unmatched, non-fast... Tay Ray Chuan Fri, 8 Jan 2010 02:12:41 +0000 (10:12 +0800)

t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs

Some refs can only be matched to a remote ref with an explicit refspec.
When such a ref is a non-fast-forward of its remote ref, test that
pushing them (with the explicit refspec specified) fails with a non-
fast-foward-type error (viz. printing of ref status and help message).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5541-http-push.sh: add tests for non-fast-forward... Tay Ray Chuan Fri, 8 Jan 2010 02:12:40 +0000 (10:12 +0800)

t5541-http-push.sh: add tests for non-fast-forward pushes

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

base85: Make the code more obvious instead of explainin... Andreas Gruenbacher Fri, 8 Jan 2010 13:40:00 +0000 (14:40 +0100)

base85: Make the code more obvious instead of explaining the non-obvious

Here is another cleanup ...

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

base85: encode_85() does not use the decode tableAndreas Gruenbacher Fri, 8 Jan 2010 16:22:18 +0000 (17:22 +0100)

base85: encode_85() does not use the decode table

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

base85 debug code: Fix length byte calculationAndreas Gruenbacher Fri, 8 Jan 2010 13:39:58 +0000 (14:39 +0100)

base85 debug code: Fix length byte calculation

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-diff.txt: Link to git-difftoolDavid Aguilar Sun, 10 Jan 2010 04:02:43 +0000 (20:02 -0800)

git-diff.txt: Link to git-difftool

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool: Allow specifying unconfigured commands with... David Aguilar Sun, 10 Jan 2010 04:02:42 +0000 (20:02 -0800)

difftool: Allow specifying unconfigured commands with --extcmd

git-difftool requires difftool.<tool>.cmd configuration even when
tools use the standard "$diffcmd $from $to" form. This teaches
git-difftool to run these tools in lieu of configuration by
allowing the command to be specified on the command line.

Reference: http://article.gmane.org/gmane.comp.version-control.git/133377
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool--helper: Remove use of the GIT_MERGE_TOOL... David Aguilar Sun, 10 Jan 2010 04:02:41 +0000 (20:02 -0800)

difftool--helper: Remove use of the GIT_MERGE_TOOL variable

An undocumented mis-feature in git-difftool is that it allows you
to specify a default difftool by setting GIT_MERGE_TOOL.
This behavior was never documented and was included as an
oversight back when git-difftool was maintained outside of git.

git-mergetool never honored GIT_MERGE_TOOL so neither should
git-difftool.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool--helper: Update copyright and remove distracti... David Aguilar Sun, 10 Jan 2010 04:02:40 +0000 (20:02 -0800)

difftool--helper: Update copyright and remove distracting comments

Some of the comments in git-difftool--helper are not needed because
the code is sufficiently readable without them.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: tiny git config manual tweaksJonathan Nieder Sun, 10 Jan 2010 03:01:21 +0000 (21:01 -0600)

Documentation: tiny git config manual tweaks

As a verb, 'setup' is spelled 'set up'. “diff commands such as
diff-files” scans better without a comma. Clarify that shallow
and deep are special non-boolean values for format.thread rather
than boolean values with some other name.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git gc packs refs by default nowJonathan Nieder Sun, 10 Jan 2010 02:59:41 +0000 (20:59 -0600)

Documentation: git gc packs refs by default now

In commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24), 'git gc' was changed to run pack-refs by default

Versions before v1.5.1.2 cannot clone repos with packed refs over
http, and versions before v1.4.4 cannot handled packed refs at
all, but more recent git should have no problems. Try to make
this more clear in the git-config manual.

The analagous passage in git-gc.txt was updated already with
commit fe2128a (Change git-gc documentation to reflect
gc.packrefs implementation., 2008-01-09).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Reset possible helper before reusing remote structureIlari Liusvaara Sat, 9 Jan 2010 17:28:12 +0000 (19:28 +0200)

Reset possible helper before reusing remote structure

If one had multiple URLs configured for remote with previous one
having forced helper but the subsequent one not, like:

url = foo::bar://baz
url = ssh://example/example.git

Then the subsequent URL is passed to foo helper, which isn't
correct. Fix it to be parsed normally by resetting foreign VCS
name before parsing the URL protocol.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: warn prominently against merging with... Thomas Rast Thu, 7 Jan 2010 16:42:27 +0000 (17:42 +0100)

Documentation: warn prominently against merging with dirty trees

We do this for both git-merge and git-pull, so as to hopefully alert
(over)users of git-pull to the issue.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>

Documentation/git-merge: reword references to "remote... Thomas Rast Thu, 7 Jan 2010 16:32:19 +0000 (17:32 +0100)

Documentation/git-merge: reword references to "remote" and "pull"

The git-merge manpage was written in terms of merging a "remote",
which is no longer the case: you merge local or remote-tracking
branches; pull is for actual remotes.

Adjust the manpage accordingly. We refer to the arguments as
"commits", and change instances of "remote" to "other" (where branches
are concerned) or "theirs" (where conflict sides are concerned).
Remove the single reference to "pulling".

Signed-off-by: Thomas Rast <trast@student.ethz.ch>

ls-files: fix overeager pathspec optimizationJunio C Hamano Sat, 9 Jan 2010 07:05:41 +0000 (23:05 -0800)

ls-files: fix overeager pathspec optimization

Given pathspecs that share a common prefix, ls-files optimized its call
into recursive directory reader by starting at the common prefix
directory.

If you have a directory "t" with an untracked file "t/junk" in it, but the
top-level .gitignore file told us to ignore "t/", this resulted in:

$ git ls-files -o --exclude-standard
$ git ls-files -o --exclude-standard t/
t/junk
$ git ls-files -o --exclude-standard t/junk
t/junk
$ cd t && git ls-files -o --exclude-standard
junk

We could argue that you are overriding the ignore file by giving a
patchspec that matches or being in that directory, but it is somewhat
unexpected. Worse yet, these behave differently:

$ git ls-files -o --exclude-standard t/ .
$ git ls-files -o --exclude-standard t/
t/junk

This patch changes the optimization so that it notices when the common
prefix directory that it starts reading from is an ignored one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_directory(): further split treat_path()Junio C Hamano Sat, 9 Jan 2010 04:56:16 +0000 (20:56 -0800)

read_directory(): further split treat_path()

The next caller I'll be adding won't have an access to struct dirent
because it won't be reading from a directory stream. Split the main
part of the function further into a separate function to make it usable
by a caller without passing a dirent as long as it knows what type is
feeding the function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_directory_recursive(): refactor handling of a... Junio C Hamano Sat, 9 Jan 2010 03:14:07 +0000 (19:14 -0800)

read_directory_recursive(): refactor handling of a single path into a separate function

Primarily because I want to reuse it in a separate function later,
but this de-dents a huge function by one tabstop which by itself is
an improvement as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3001: test ls-files -o ignored/dirJunio C Hamano Sat, 9 Jan 2010 07:07:17 +0000 (23:07 -0800)

t3001: test ls-files -o ignored/dir

When you have "t" directory that is marked as ignored in the top-level
.gitignore file (or $GIT_DIR/info/exclude), running

$ git ls-files -o --exclude-standard

from the top-level correctly excludes files in "t" directory, but
any of the following:

$ git ls-files -o --exclude-standard t/
$ cd t && git ls-files -o --exclude-standard

would show untracked files in that directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

ident.c: remove unused variablesJunio C Hamano Fri, 8 Jan 2010 13:53:56 +0000 (05:53 -0800)

ident.c: remove unused variables

d5cc2de (ident.c: Trim hint printed when gecos is empty., 2006-11-28)
reworded the message used as printf() format and dropped "%s" from it;
these two variables that hold the names of GIT_{AUTHOR,COMMITTER}_NAME
environment variables haven't been used since then.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Describe second batch for 1.7.0 in draft release notesJunio C Hamano Thu, 7 Jan 2010 23:47:32 +0000 (15:47 -0800)

Describe second batch for 1.7.0 in draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/filter-branch-prime'Junio C Hamano Thu, 7 Jan 2010 23:40:30 +0000 (15:40 -0800)

Merge branch 'js/filter-branch-prime'

* js/filter-branch-prime:
filter-branch: remove an unnecessary use of 'git read-tree'

Merge branch 'sb/maint-octopus'Junio C Hamano Thu, 7 Jan 2010 23:40:21 +0000 (15:40 -0800)

Merge branch 'sb/maint-octopus'

* sb/maint-octopus:
octopus: remove dead code
octopus: reenable fast-forward merges
octopus: make merge process simpler to follow

Conflicts:
git-merge-octopus.sh

Merge branch 'mg/tag-d-show'Junio C Hamano Thu, 7 Jan 2010 23:38:50 +0000 (15:38 -0800)

Merge branch 'mg/tag-d-show'

* mg/tag-d-show:
tag -d: print sha1 of deleted tag

Merge branch 'so/cvsserver-update'Junio C Hamano Thu, 7 Jan 2010 23:38:11 +0000 (15:38 -0800)

Merge branch 'so/cvsserver-update'

* so/cvsserver-update:
cvsserver: make the output of 'update' more compatible with cvs.

Merge branch 'bg/maint-add-all-doc'Junio C Hamano Thu, 7 Jan 2010 23:37:57 +0000 (15:37 -0800)

Merge branch 'bg/maint-add-all-doc'

* bg/maint-add-all-doc:
git-rm doc: Describe how to sync index & work tree
git-add/rm doc: Consistently back-quote
Documentation: 'git add -A' can remove files

git-rm doc: Describe how to sync index & work treeBjörn Gustavsson Mon, 7 Dec 2009 18:35:42 +0000 (19:35 +0100)

git-rm doc: Describe how to sync index & work tree

Newcomers to git that want to remove from the index only the
files that have disappeared from the working tree will probably
look for a way to do that in the documentation for 'git rm'.

Therefore, describe how that can be done (even though it involves
other commands than 'git rm'). Based on a suggestion by Junio,
but re-arranged and rewritten to better fit into the style of
command reference.

While at it, change a single occurrence of "work tree" to "working
tree" for consistency.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mv/commit-date'Junio C Hamano Thu, 7 Jan 2010 23:35:55 +0000 (15:35 -0800)

Merge branch 'mv/commit-date'

* mv/commit-date:
Document date formats accepted by parse_date()
builtin-commit: add --date option

Merge branch 'mo/bin-wrappers'Junio C Hamano Thu, 7 Jan 2010 23:35:52 +0000 (15:35 -0800)

Merge branch 'mo/bin-wrappers'

* mo/bin-wrappers:
INSTALL: document a simpler way to run uninstalled builds
run test suite without dashed git-commands in PATH
build dashless "bin-wrappers" directory similar to installed bindir

read-tree --debug-unpackJunio C Hamano Mon, 14 Sep 2009 09:22:00 +0000 (02:22 -0700)

read-tree --debug-unpack

A debugging patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees.c: look ahead in the indexJunio C Hamano Sun, 20 Sep 2009 07:03:39 +0000 (00:03 -0700)

unpack-trees.c: look ahead in the index

This makes the traversal of index be in sync with the tree traversal.
When unpack_callback() is fed a set of tree entries from trees, it
inspects the name of the entry and checks if the an index entry with
the same name could be hiding behind the current index entry, and

(1) if the name appears in the index as a leaf node, it is also
fed to the n_way_merge() callback function;

(2) if the name is a directory in the index, i.e. there are entries in
that are underneath it, then nothing is fed to the n_way_merge()
callback function;

(3) otherwise, if the name comes before the first eligible entry in the
index, the index entry is first unpacked alone.

When traverse_trees_recursive() descends into a subdirectory, the
cache_bottom pointer is moved to walk index entries within that directory.

All of these are omitted for diff-index, which does not even want to be
fed an index entry and a tree entry with D/F conflicts.

This fixes 3-way read-tree and exposes a bug in other parts of the system
in t6035, test #5. The test prepares these three trees:

O = HEAD^
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/b-2/c/d
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/b/c/d
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/x

A = HEAD
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/b-2/c/d
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/b/c/d
100644 blob 587be6b4c3f93f93c489c0111bba5596147a26cb a/x

B = master
120000 blob a36b77384451ea1de7bd340ffca868249626bc52 a/b
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/b-2/c/d
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a/x

With a clean index that matches HEAD, running

git read-tree -m -u --aggressive $O $A $B

now yields

120000 a36b77384451ea1de7bd340ffca868249626bc52 3 a/b
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 a/b-2/c/d
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 1 a/b/c/d
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 2 a/b/c/d
100644 587be6b4c3f93f93c489c0111bba5596147a26cb 0 a/x

which is correct. "master" created "a/b" symlink that did not exist,
and removed "a/b/c/d" while HEAD did not do touch either path.

Before this series, read-tree did not notice the situation and resolved
addition of "a/b" and removal of "a/b/c/d" independently. If A = HEAD had
another path "a/b/c/e" added, this merge should conflict but instead it
silently resolved "a/b" and then immediately overwrote it to add
"a/b/c/e", which was quite bogus.

Tests in t1012 start to work with this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees.c: prepare for looking ahead in the indexJunio C Hamano Thu, 7 Jan 2010 22:59:54 +0000 (14:59 -0800)

unpack-trees.c: prepare for looking ahead in the index

This prepares but does not yet implement a look-ahead in the index entries
when traverse-trees.c decides to give us tree entries in an order that
does not match what is in the index.

A case where a look-ahead in the index is necessary happens when merging
branch B into branch A while the index matches the current branch A, using
a tree O as their common ancestor, and these three trees looks like this:

O A B
t t
t-i t-i t-i
t-j t-j
t/1
t/2

The traverse_trees() function gets "t", "t-i" and "t" from trees O, A and
B first, and notices that A may have a matching "t" behind "t-i" and "t-j"
(indeed it does), and tells A to give that entry instead. After unpacking
blob "t" from tree B (as it hasn't changed since O in B and A removed it,
it will result in its removal), it descends into directory "t/".

The side that walked index in parallel to the tree traversal used to be
implemented with one pointer, o->pos, that points at the next index entry
to be processed. When this happens, the pointer o->pos still points at
"t-i" that is the first entry. We should be able to skip "t-i" and "t-j"
and locate "t/1" from the index while the recursive invocation of
traverse_trees() walks and match entries found there, and later come back
to process "t-i".

While that look-ahead is not implemented yet, this adds a flag bit,
CE_UNPACKED, to mark the entries in the index that has already been
processed. o->pos pointer has been renamed to o->cache_bottom and it
points at the first entry that may still need to be processed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: teach --onto A...B syntaxNanako Shiraishi Thu, 7 Jan 2010 11:05:09 +0000 (20:05 +0900)

rebase -i: teach --onto A...B syntax

When rewriting commits on a topic branch, sometimes it is easier to
compare the version of commits before and after the rewrite if they are
based on the same commit that forked from the upstream. An earlier commit
by Junio (fixed up by the previous commit) gives "--onto A...B" syntax to
rebase command, and rebases on top of the merge base between A and B;
teach the same to the interactive version, too.

Signed-off-by: しらいし ななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: fix --onto A...B parsing and add testsNanako Shiraishi Thu, 7 Jan 2010 11:05:02 +0000 (20:05 +0900)

rebase: fix --onto A...B parsing and add tests

The previous patch didn't parse "rebase --onto A...B" correctly when A
isn't an empty string. It also tried to be careful to notice a case in
which there are more than one merge bases, but forgot to give --all option
to merge-base, making the test pointless.

Fix these problems and add a test script to verify. Improvements to the
script to parse A...B syntax was taken from review comments by Johannes
Schindelin.

Signed-off-by: しらいし ななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout -m: do not try to fall back to --merge from... Junio C Hamano Thu, 7 Jan 2010 07:51:47 +0000 (23:51 -0800)

checkout -m: do not try to fall back to --merge from an unborn branch

If switching from an unborn branch (= empty tree) to a valid commit failed
without -m, it would fail with -m option as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7002: test for not using external grep on skip-worktre... Nguyễn Thái Ngọc Duy Mon, 4 Jan 2010 12:34:15 +0000 (19:34 +0700)

t7002: test for not using external grep on skip-worktree paths

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7002: set test prerequisite "external-grep" if supportedNguyễn Thái Ngọc Duy Mon, 4 Jan 2010 12:34:14 +0000 (19:34 +0700)

t7002: set test prerequisite "external-grep" if supported

Add another test to set prerequisite EXTGREP if the current build supports
external grep. This can be used to skip external grep only tests on builds
that do not support this optimization.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: Add hotkeys for "Unstage from commit" and... Vitaly _Vi Shukela Thu, 31 Dec 2009 13:32:53 +0000 (15:32 +0200)

git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"

Signed-off-by: Vitaly _Vi Shukela <public_vi@tut.by>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Makefile: consolidate .FORCE-* targetsJonathan Nieder Wed, 6 Jan 2010 08:16:38 +0000 (02:16 -0600)

git-gui: Makefile: consolidate .FORCE-* targets

Providing multiple targets to force a rebuild is unnecessary
complication.

Avoid using a name that could conflict with future special
targets in GNU make (a leading period followed by uppercase
letters).

Cc: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

rebase -i --autosquash: auto-squash commitsNanako Shiraishi Tue, 8 Dec 2009 03:13:14 +0000 (12:13 +0900)

rebase -i --autosquash: auto-squash commits

Teach a new option, --autosquash, to the interactive rebase.
When the commit log message begins with "!fixup ...", and there
is a commit whose title begins with the same ..., automatically
modify the todo list of rebase -i so that the commit marked for
squashing come right after the commit to be modified, and change
the action of the moved commit from pick to squash.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout -m path: fix recreating conflictsJunio C Hamano Wed, 6 Jan 2010 20:32:02 +0000 (12:32 -0800)

checkout -m path: fix recreating conflicts

We should tell ll_merge() that the 3-way merge between stages #2 and #3 is
an outermost merge, not a virtual-ancestor creation.

Back when this code was originally written, users couldn't write custom
merge drivers easily, so the bug didn't matter, but these days it does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

.gitattributes: detect 8-space indent in shell scriptsJunio C Hamano Wed, 6 Jan 2010 20:22:25 +0000 (12:22 -0800)

.gitattributes: detect 8-space indent in shell scripts

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: consolidate .FORCE-* targetsJonathan Nieder Wed, 6 Jan 2010 08:06:58 +0000 (02:06 -0600)

Makefile: consolidate .FORCE-* targets

Providing multiple targets to force a rebuild is unnecessary
complication.

Avoid using a name that could conflict with future special
targets in GNU make (a leading period followed by uppercase
letters).

The corresponding change to the git-gui Makefile is left for
another patch.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: learn to generate listings for targets requir... Jonathan Nieder Wed, 6 Jan 2010 08:06:03 +0000 (02:06 -0600)

Makefile: learn to generate listings for targets requiring special flags

'make git.s' to debug code generation of main() fails because
git.c makes use of preprocessor symbols such as GIT_VERSION that
are not set. make does not generate code listings for
builtin_help.c, exec_cmd.c, builtin-init-db.c, config.c, http.c,
or http-walker.c either, for the same reason.

So pass the flags used to generate each .o file when generating
the corresponding assembler listing.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: use target-specific variable to pass flags... Jonathan Nieder Wed, 6 Jan 2010 08:05:04 +0000 (02:05 -0600)

Makefile: use target-specific variable to pass flags to cc

This allows reusing the standard %.o: %.c pattern rule even for
targets that require special flags to be set. Thus after this
change, any changes in the command for compilation only have to
be performed in one place.

Target-specific variables have been supported in GNU make since
version 3.77, which has been available since 1998.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: regenerate assembler listings when askedJonathan Nieder Wed, 6 Jan 2010 08:04:20 +0000 (02:04 -0600)

Makefile: regenerate assembler listings when asked

'make var.s' fails to regenerate an assembler listing if var.c
has not changed but a header it includes has:

$ make var.s
CC var.s
$ touch cache.h
$ make var.s
$

The corresponding problem for 'make var.o' does not occur because
the Makefile lists dependencies for each .o target explicitly;
analogous dependency rules for the .s targets are not present.
Rather than add some, it seems better to force 'make' to always
regenerate assembler listings, since the assembler listing
targets are only invoked when specifically requested on the make
command line.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Smart-http tests: Test http-backend without curl or... Tarmigan Casebolt Sat, 2 Jan 2010 21:43:59 +0000 (13:43 -0800)

Smart-http tests: Test http-backend without curl or a webserver

This reuses many of the tests from the old t5560 but runs those tests
without curl or a webserver. This will hopefully increase the testing
coverage for http-backend because it does not require users to set
GIT_TEST_HTTPD.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Smart-http tests: Break test t5560-http-backend into... Tarmigan Casebolt Sat, 2 Jan 2010 21:38:06 +0000 (13:38 -0800)

Smart-http tests: Break test t5560-http-backend into pieces

This should introduce no functional change in the tests or the amount
of test coverage.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Smart-http tests: Improve coverage in test t5560Tarmigan Casebolt Sat, 2 Jan 2010 21:38:05 +0000 (13:38 -0800)

Smart-http tests: Improve coverage in test t5560

Commit 34b6cb8bb ("http-backend: Protect GIT_PROJECT_ROOT from /../
requests") added the path_info helper function to test t5560 but did
not use it. We should use it as it provides another level of error
checking.

The /etc/.../passwd case is one that is not special (and the test
fails for reasons other than being aliased), so we remove that test
case.

Also rename the function from 'path_info' to 'expect_aliased'.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Smart-http: check if repository is OK to export before... Tarmigan Casebolt Mon, 28 Dec 2009 21:49:00 +0000 (16:49 -0500)

Smart-http: check if repository is OK to export before serving it

Similar to how git-daemon checks whether a repository is OK to be
exported, smart-http should also check. This check can be satisfied
in two different ways: the environmental variable GIT_HTTP_EXPORT_ALL
may be set to export all repositories, or the individual repository
may have the file git-daemon-export-ok.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-http.sh: Restructure finding of default httpd... Tarmigan Casebolt Sat, 2 Jan 2010 22:04:25 +0000 (14:04 -0800)

t/lib-http.sh: Restructure finding of default httpd location

On CentOS 5, httpd is located at /usr/sbin/httpd, and the modules are
located at /usr/lib64/httpd/modules. To enable easy testing of httpd,
we would like those locations to be detected automatically.

uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across. We do the same for the
modules directory.

cc: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4030, t4031: work around bogus MSYS bash path conversionJohannes Sixt Fri, 1 Jan 2010 22:15:18 +0000 (23:15 +0100)

t4030, t4031: work around bogus MSYS bash path conversion

Recall that MSYS bash converts POSIX style absolute paths to Windows style
absolute paths. Unfortunately, it converts a program argument that begins
with a double-quote and otherwise looks like an absolute POSIX path, but
in doing so, it strips everything past the second double-quote[*]. This
case is triggered in the two test scripts. The work-around is to place the
Windows style path returned by $(pwd) between the quotes to avoid the path
conversion.

[*] It is already bogus that a conversion is even considered when a program
argument begins with a double-quote because it cannot be an absolute POSIX
path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: run external diff helper with shellJeff King Wed, 30 Dec 2009 11:03:35 +0000 (06:03 -0500)

diff: run external diff helper with shell

This is mostly to make it more consistent with the rest of
git, which uses the shell to exec helpers.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

textconv: use shell to run helperJeff King Wed, 30 Dec 2009 11:01:09 +0000 (06:01 -0500)

textconv: use shell to run helper

Currently textconv helpers are run directly. Running through
the shell is useful because the user can provide a program
with command line arguments, like "antiword -f".

It also makes textconv more consistent with other parts of
git, most of which run their helpers using the shell.

The downside is that textconv helpers with shell
metacharacters (like space) in the filename will be broken.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

editor: use run_command's shell featureJeff King Wed, 30 Dec 2009 10:56:16 +0000 (05:56 -0500)

editor: use run_command's shell feature

Now that run_command implements the same code in a more
general form, we can make use of it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: optimize out useless shell callsJeff King Wed, 30 Dec 2009 10:55:36 +0000 (05:55 -0500)

run-command: optimize out useless shell calls

If there are no metacharacters in the program to be run, we
can just skip running the shell entirely and directly exec
the program.

The metacharacter test is pulled verbatim from
launch_editor, which already implements this optimization.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: convert simple callsites to use_shellJeff King Wed, 30 Dec 2009 10:53:57 +0000 (05:53 -0500)

run-command: convert simple callsites to use_shell

Now that we have the use_shell feature, these callsites can
all be converted with small changes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021: use $SHELL_PATH for the filter scriptJohannes Sixt Fri, 1 Jan 2010 22:14:06 +0000 (23:14 +0100)

t0021: use $SHELL_PATH for the filter script

On Windows, we need the shbang line to correctly invoke shell scripts via
a POSIX shell, except when the script is invoked via 'sh -c' because sh (a
bash) does "the right thing". But the clean and smudge filters will not
always be invoked via 'sh -c'; to futureproof, we should mark the the one
in t0021-conversion with #!$SHELL_PATH.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: make ppc/sha1ppc.o depend on GIT-CFLAGSJonathan Nieder Wed, 6 Jan 2010 06:37:59 +0000 (00:37 -0600)

Makefile: make ppc/sha1ppc.o depend on GIT-CFLAGS

The %.o: %.S pattern rule should depend on GIT-CFLAGS to avoid
trouble when ALL_CFLAGS changes.

The pattern only applies to one file (ppc/sha1ppc.S) and that
file does not use any #ifdefs, so leaving the dependency out is
probably harmless. Nevertheless, it is safer to include the
dependency in case future code's behavior does depend on the
build flags.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: reset: add some missing tablesChristian Couder Tue, 5 Jan 2010 05:58:30 +0000 (06:58 +0100)

Documentation: reset: add some missing tables

and while at it also explain why --merge option is disallowed in some
cases.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix bit assignment for CE_CONFLICTEDJunio C Hamano Mon, 4 Jan 2010 08:02:00 +0000 (00:02 -0800)

Fix bit assignment for CE_CONFLICTED

CE_WT_REMOVE has already grabbed the same value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Aggressive three-way merge: fix D/F caseJunio C Hamano Sun, 11 Oct 2009 20:38:11 +0000 (13:38 -0700)

Aggressive three-way merge: fix D/F case

When the ancestor used to have a blob "P", your tree removed it, and the
tree you are merging with also removed it, the agressive three-way cleanly
merges to remove that blob. If the other tree added a new blob "P/Q"
while removing "P", it should also merge cleanly to remove "P" and create
"P/Q" (since neither the ancestor nor your tree could have had it, so it
is a typical "created in one").

The "aggressive" rule is not new anymore. Reword the stale comment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

traverse_trees(): handle D/F conflict case sanelyJunio C Hamano Sat, 19 Sep 2009 21:07:14 +0000 (14:07 -0700)

traverse_trees(): handle D/F conflict case sanely

traverse_trees() is supposed to call its callback with all the matching
entries from the given trees. The current algorithm keeps a pointer to
each of the tree being traversed, and feeds the entry with the earliest
name to the callback.

This breaks down if the trees being traversed looks like this:

A B
t-1 t
t-2 u
t/a v

When we are currently looking at an entry "t-1" in tree A, and tree B has
returned "t", feeding "t" from the B and not feeding anything from A, only
because "t-1" sorts later than "t", will miss an entry for a subtree "t"
behind the current entry in tree A.

This introduces extended_entry_extract() helper function that gives what
name is expected from the tree, and implements a mechanism to look-ahead
in the tree object using it, to make sure such a case is handled sanely.
Traversal in tree A in the above example will first return "t" to match
that of B, and then the next request for an entry to A then returns "t-1".

This roughly corresponds to what Linus's "prepare for one-entry lookahead"
wanted to do, but because this does implement look ahead, t6035 and one more
test in t1012 reveal that the approach would not work without adjusting the
side that walks the index in unpack_trees() as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

more D/F conflict testsJunio C Hamano Sun, 20 Sep 2009 18:49:56 +0000 (11:49 -0700)

more D/F conflict tests

Before starting to muck with this code, let's expose the current
breakages that we intend to fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: move convenience regexp to match object names... Junio C Hamano Sun, 20 Sep 2009 18:10:14 +0000 (11:10 -0700)

tests: move convenience regexp to match object names to test-lib.sh

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use warning function instead of fprintf(stderr, "Warnin... Thiago Farina Sun, 3 Jan 2010 16:20:30 +0000 (11:20 -0500)

Use warning function instead of fprintf(stderr, "Warning: ...").

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

"reset --merge": fix unmerged caseJunio C Hamano Fri, 1 Jan 2010 07:04:04 +0000 (23:04 -0800)

"reset --merge": fix unmerged case

Commit 9e8ecea (Add 'merge' mode to 'git reset', 2008-12-01) disallowed
"git reset --merge" when there was unmerged entries. But it wished if
unmerged entries were reset as if --hard (instead of --merge) has been
used. This makes sense because all "mergy" operations makes sure that
any path involved in the merge does not have local modifications before
starting, so resetting such a path away won't lose any information.

The previous commit changed the behavior of --merge to accept resetting
unmerged entries if they are reset to a different state than HEAD, but it
did not reset the changes in the work tree, leaving the conflict markers
in the resulting file in the work tree.

Fix it by doing three things:

- Update the documentation to match the wish of original "reset --merge"
better, namely, "An unmerged entry is a sign that the path didn't have
any local modification and can be safely resetted to whatever the new
HEAD records";

- Update read_index_unmerged(), which reads the index file into the cache
while dropping any higher-stage entries down to stage #0, not to copy
the object name from the higher stage entry. The code used to take the
object name from the a stage entry ("base" if you happened to have
stage #1, or "ours" if both sides added, etc.), which essentially meant
that you are getting random results depending on what the merge did.

The _only_ reason we want to keep a previously unmerged entry in the
index at stage #0 is so that we don't forget the fact that we have
corresponding file in the work tree in order to be able to remove it
when the tree we are resetting to does not have the path. In order to
differentiate such an entry from ordinary cache entry, the cache entry
added by read_index_unmerged() is marked as CE_CONFLICTED.

- Update merged_entry() and deleted_entry() so that they pay attention to
cache entries marked as CE_CONFLICTED. They are previously unmerged
entries, and the files in the work tree that correspond to them are
resetted away by oneway_merge() to the version from the tree we are
resetting to.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: use "unpack_trees()" directly instead of "git... Stephan Beyer Wed, 30 Dec 2009 05:54:47 +0000 (06:54 +0100)

reset: use "unpack_trees()" directly instead of "git read-tree"

This patch makes "reset_index_file()" call "unpack_trees()" directly
instead of forking and execing "git read-tree". So the code is more
efficient.

And it's also easier to see which unpack_tree() options will be used,
as we don't need to follow "git read-tree"'s command line parsing
which is quite complex.

As Daniel Barkalow found, there is a difference between this new
version and the old one. The old version gives an error for
"git reset --merge" with unmerged entries, and the new version does
not when we reset the entries to some states that differ from HEAD.
Instead, it resets the index entry and succeeds, while leaving the
conflict markers in the corresponding file in the work tree (which
will be corrected by the next patch).

The code comes from the sequencer GSoC project:

git://repo.or.cz/git/sbeyer.git

(at commit 5a78908b70ceb5a4ea9fd4b82f07ceba1f019079)

Mentored-by: Daniel Barkalow <barkalow@iabervon.org>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-difftool: Add '--gui' for selecting a GUI toolDavid Aguilar Wed, 23 Dec 2009 05:27:14 +0000 (21:27 -0800)

git-difftool: Add '--gui' for selecting a GUI tool

Users might prefer to have git-difftool use a different
tool when run from a Git GUI.

This teaches git-difftool to honor 'diff.guitool' when
the '--gui' option is specified. This allows users to
configure their preferred command-line diff tool in
'diff.tool' and a GUI diff tool in 'diff.guitool'.

Reference: http://article.gmane.org/gmane.comp.version-control.git/133386
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800-difftool: Set a bogus tool for use by testsDavid Aguilar Wed, 23 Dec 2009 05:27:13 +0000 (21:27 -0800)

t7800-difftool: Set a bogus tool for use by tests

If a difftool test has an error then running the git test suite
may end up invoking a GUI diff tool. We now guard against this
by setting a difftool.bogus-tool.cmd variable.

The tests already used --tool=bogus-tool in various places so
this is simply ensuring that nothing ever falls back and
finds a real diff tool.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 3 Jan 2010 07:04:11 +0000 (23:04 -0800)

Merge branch 'maint'

* maint:
stash: mention --patch in usage string.

stash: mention --patch in usage string.Matthieu Moy Sat, 2 Jan 2010 16:35:32 +0000 (17:35 +0100)

stash: mention --patch in usage string.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: add "use shell" optionJeff King Wed, 30 Dec 2009 10:53:16 +0000 (05:53 -0500)

run-command: add "use shell" option

Many callsites run "sh -c $CMD" to run $CMD. We can make it
a little simpler for them by factoring out the munging of
argv.

For simple cases with no arguments, this doesn't help much, but:

1. For cases with arguments, we save the caller from
having to build the appropriate shell snippet.

2. We can later optimize to avoid the shell when
there are no metacharacters in the program.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 31 Dec 2009 23:00:38 +0000 (15:00 -0800)

Merge branch 'maint'

* maint:
branch: die explicitly why when calling "git branch [-a|-r] branchname".
fast-import: Document author/committer/tagger name is optional
SubmittingPatches: hints to know the status of a submitted patch.

Merge branch 'maint-1.6.0' into maintJunio C Hamano Thu, 31 Dec 2009 23:00:14 +0000 (15:00 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
branch: die explicitly why when calling "git branch [-a|-r] branchname".

branch: die explicitly why when calling "git branch... Matthieu Moy Wed, 30 Dec 2009 14:45:31 +0000 (15:45 +0100)

branch: die explicitly why when calling "git branch [-a|-r] branchname".

The -a and -r options used to be silently ignored in such a command.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: Document author/committer/tagger name... Shawn O. Pearce Wed, 30 Dec 2009 15:03:48 +0000 (07:03 -0800)

fast-import: Document author/committer/tagger name is optional

The fast-import parser does not validate that the author, committer
or tagger name component contains both a name and an email address.
Therefore the name component has always been optional. Correct the
documentation to match the implementation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: hints to know the status of a submit... Matthieu Moy Wed, 30 Dec 2009 14:51:22 +0000 (15:51 +0100)

SubmittingPatches: hints to know the status of a submitted patch.

"What happened to my patch" is pretty much a FAQ on the Git mailing list,
it deserves a few paragraphs in SubmittingPatches...

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: factor submodules into dirty stateThomas Rast Thu, 31 Dec 2009 11:48:41 +0000 (12:48 +0100)

bash completion: factor submodules into dirty state

In the implementation of GIT_PS1_SHOWDIRTYSTATE in 738a94a (bash:
offer to show (un)staged changes, 2009-02-03), I cut&pasted the
git-diff invocations from dirty-worktree checks elsewhere, carrying
along the --ignore-submodules option.

As pointed out by Kevin Ballard, this doesn't really make sense: to
the _user_, a changed submodule counts towards uncommitted changes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix "git remote update" with remotes.defalt setBjörn Gustavsson Thu, 31 Dec 2009 09:43:17 +0000 (10:43 +0100)

Fix "git remote update" with remotes.defalt set

Starting from commit 8db35596, "git remote update" (with no
group name given) will fail with the following message if
remotes.default has been set in the config file:

fatal: 'default' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

The problem is that the --multiple option is not passed to
"git fetch" if no remote or group name is given on the command
line. Fix the problem by always passing the --multiple
option to "git fetch" (which actually simplifies the code).

Reported-by: YONETANI Tomokazu
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-config: add --path option doing ~ and ~user... Matthieu Moy Wed, 30 Dec 2009 16:51:53 +0000 (17:51 +0100)

builtin-config: add --path option doing ~ and ~user expansion.

395de250 (Expand ~ and ~user in core.excludesfile, commit.template)
introduced a C function git_config_pathname, doing ~/ and ~user/
expansion. This patch makes the feature available to scripts with 'git
config --get --path'.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: make the output of 'update' more compatible... Sergei Organov Mon, 7 Dec 2009 11:11:44 +0000 (14:11 +0300)

cvsserver: make the output of 'update' more compatible with cvs.

Native cvs update outputs the string "cvs update: Updating <DIR>" for
every directory it processes (to stderr) unless -q or -Q is given on
comman-line. This is used, e.g., by emacs pcl-cvs to split files by
directory. This commit implements this feature in cvsserver.

Signed-off-by: Sergei Organov <osv@javad.com>
Acked-by: Martin Langhoff <martin.langhoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: add space between branch name and... Shawn O. Pearce Thu, 31 Dec 2009 03:04:38 +0000 (19:04 -0800)

bash completion: add space between branch name and status flags

Improve the readability of the bash prompt by adding a space between
the branch name and the status flags (dirty, stash, untracked).

While we are cleaning up this section of code, the two cases for
formatting the prompt are identical except for the format string,
so make them the same.

Suggested-by: Roman Fietze <roman.fietze@telemotive.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: do not do external grep on skip-worktree entriesNguyễn Thái Ngọc Duy Wed, 30 Dec 2009 14:11:44 +0000 (21:11 +0700)

grep: do not do external grep on skip-worktree entries

Skip-worktree entries are not on disk. We cannot use external grep in such
cases.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

CVS Server: Support reading base and roots from environmentPhil Miller Wed, 30 Dec 2009 19:35:31 +0000 (13:35 -0600)

CVS Server: Support reading base and roots from environment

The Gitosis single-account Git/ssh hosting system runs git commands
through git-shell after confirming that the connecting user is
authorized to access the requested repository. This works well for
upload-pack and receive-pack, which take a repository argument through
git-shell. This doesn't work so well for `cvs server', which is passed
through literally, with no arguments. Allowing arguments risks
sneaking in `--export-all', so that restriction should be maintained.

Despite that, passing a repository root is necessary for per-user
access control by the hosting software, and passing a base path
improves usability without weakening security. Thus, git-cvsserver
needs to come up with these values at runtime by some other
means. Since git-shell preserves the environment for other purposes,
the environment can carry these arguments as well.

Thus, modify git-cvsserver to read $GIT_CVSSERVER_{BASE_PATH,ROOT} in
the absence of equivalent command line arguments.

Signed-off-by: Phil Miller <mille121@illinois.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-push: add --delete as syntactic sugar for :fooJan Krüger Wed, 30 Dec 2009 19:57:42 +0000 (20:57 +0100)

builtin-push: add --delete as syntactic sugar for :foo

Refspecs without a source side have been reported as confusing by many.
As an alternative, this adds support for commands like:

git push origin --delete somebranch
git push origin --delete tag sometag

Specifically, --delete will prepend a colon to all colon-less refspecs
given on the command line, and will refuse to accept refspecs with
colons to prevent undue confusion.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add completion for git-svn mkdirs,reset,and gcRobert Zeh Wed, 30 Dec 2009 00:58:48 +0000 (18:58 -0600)

Add completion for git-svn mkdirs,reset,and gc

Signed-off-by: Robert Zeh <robert.a.zeh@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 30 Dec 2009 09:25:21 +0000 (01:25 -0800)

Merge branch 'maint'

* maint:
textconv: stop leaking file descriptors
commit: --cleanup is a message option
git count-objects: handle packs bigger than 4G
t7102: make the test fail if one of its check fails
Documentation: always respect core.worktree if set

branch -d: base the "already-merged" safety on the... Junio C Hamano Wed, 30 Dec 2009 06:43:04 +0000 (22:43 -0800)

branch -d: base the "already-merged" safety on the branch it merges with

When a branch is marked to merge with another ref (e.g. local 'next' that
merges from and pushes back to origin's 'next', with 'branch.next.merge'
set to 'refs/heads/next'), it makes little sense to base the "branch -d"
safety, whose purpose is not to lose commits that are not merged to other
branches, on the current branch. It is much more sensible to check if it
is merged with the other branch it merges with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.6.1' into maintJunio C Hamano Wed, 30 Dec 2009 09:24:12 +0000 (01:24 -0800)

Merge branch 'maint-1.6.1' into maint

* maint-1.6.1:
textconv: stop leaking file descriptors
commit: --cleanup is a message option
git count-objects: handle packs bigger than 4G
t7102: make the test fail if one of its check fails

Conflicts:
builtin-commit.c
diff.c

textconv: stop leaking file descriptorsJeff King Wed, 30 Dec 2009 09:02:53 +0000 (04:02 -0500)

textconv: stop leaking file descriptors

We read the output from textconv helpers over a pipe, but we
never actually closed our end of the pipe after using it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: add a few tests for "git reset --merge"Christian Couder Wed, 30 Dec 2009 05:54:46 +0000 (06:54 +0100)

reset: add a few tests for "git reset --merge"

Commit 9e8eceab ("Add 'merge' mode to 'git reset'", 2008-12-01),
added the --merge option to git reset, but there were no test cases
for it.

This was not a big problem because "git reset" was just forking and
execing "git read-tree", but this will change in a following patch.

So let's add a few test cases to make sure that there will be no
regression.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: reset: add some tables to describe the... Christian Couder Wed, 30 Dec 2009 05:54:45 +0000 (06:54 +0100)

Documentation: reset: add some tables to describe the different options

This patch adds a DISCUSSION section that contains some tables to
show how the different "git reset" options work depending on the
states of the files in the working tree, the index, HEAD and the
target commit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: improve mixed reset error message when in a... Christian Couder Wed, 30 Dec 2009 05:54:44 +0000 (06:54 +0100)

reset: improve mixed reset error message when in a bare repo

When running a "git reset --mixed" in a bare repository, the
message displayed is something like:

fatal: This operation must be run in a work tree
fatal: Could not reset index file to revision 'HEAD^'.

This message is a little bit misleading because a mixed reset is
ok in a git directory, so it is not absolutely needed to run it in
a work tree.

So this patch improves upon the above by changing the message to:

fatal: mixed reset is not allowed in a bare repository

And if "git reset" is ever sped up by using unpack_tree() directly
(instead of execing "git read-tree"), this patch will also make
sure that a mixed reset is still disallowed in a bare repository.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: unbreak hard resets with GIT_WORK_TREEJeff King Wed, 30 Dec 2009 08:47:03 +0000 (03:47 -0500)

reset: unbreak hard resets with GIT_WORK_TREE

Commit 952dfc6 tried to tighten the safety valves for doing
a "reset --hard" in a bare repository or outside the work
tree, but accidentally broke the case for GIT_WORK_TREE.
This patch unbreaks it.

Most git commands which need a work tree simply use
NEED_WORK_TREE in git.c to die before they get to their
cmd_* function. Reset, however, only needs a work tree in
some cases, and so must handle the work tree itself. The
error that 952dfc6 made was to simply forbid certain
operations if the work tree was not set up; instead, we need
to do the same thing that NEED_WORK_TREE does, which is to
call setup_work_tree(). We no longer have to worry about dying
in the non-worktree case, as setup_work_tree handles that
for us.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: complain about path specs that don't match... René Scharfe Sat, 12 Dec 2009 15:00:41 +0000 (16:00 +0100)

archive: complain about path specs that don't match anything

Verify that all path specs match at least one path in the specified
tree and reject those that don't.

This would have made the bug fixed by 782a0005 easier to find.

This implementation is simple to the point of being stupid. It walks
the full tree for each path spec until it matches something. It's short
and seems to be fast enough, though.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano Wed, 30 Dec 2009 04:16:34 +0000 (20:16 -0800)

Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
commit: --cleanup is a message option
t7102: make the test fail if one of its check fails

commit: --cleanup is a message optionGreg Price Tue, 29 Dec 2009 21:54:49 +0000 (16:54 -0500)

commit: --cleanup is a message option

In the usage message for "git commit", the --cleanup option appeared
at the end, as one of the "contents options":

usage: git commit [options] [--] <filepattern>...
...
Commit message options
...
Commit contents options
...
--allow-empty ok to record an empty change
--cleanup <default> how to strip spaces and #comments from message

This is confusing, in part because it makes it ambiguous whether
--allow-empty, just above, refers to an empty diff or an empty message.

Move --cleanup into the 'message options' group. Also add a pair of
comments to prevent similar oversights in the future.

Signed-off-by: Greg Price <price@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>