gitweb.git
sha1-lookup: make selection of 'middle' less aggressiveJunio C Hamano Sun, 30 Dec 2007 11:13:27 +0000 (03:13 -0800)

sha1-lookup: make selection of 'middle' less aggressive

If we pick 'mi' between 'lo' and 'hi' at 50%, which was what the
simple binary search did, we are halving the search space
whether the entry at 'mi' is lower or higher than the target.

The previous patch was about picking not the middle but closer
to 'hi', when we know the target is a lot closer to 'hi' than it
is to 'lo'. However, if it turns out that the entry at 'mi' is
higher than the target, we would end up reducing the search
space only by the difference between 'mi' and 'hi' (which by
definition is less than 50% --- that was the whole point of not
using the simple binary search), which made the search less
efficient. And the risk of overshooting becomes very high, if
we try to be too precise.

This tweaks the selection of 'mi' to be a bit closer to the
middle than we would otherwise pick to avoid the problem.

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

sha1-lookup: more memory efficient search in sorted... Junio C Hamano Sat, 29 Dec 2007 10:05:47 +0000 (02:05 -0800)

sha1-lookup: more memory efficient search in sorted list of SHA-1

Currently, when looking for a packed object from the pack idx, a
simple binary search is used.

A conventional binary search loop looks like this:

unsigned lo, hi;
do {
unsigned mi = (lo + hi) / 2;
int cmp = "entry pointed at by mi" minus "target";
if (!cmp)
return mi; "mi is the wanted one"
if (cmp > 0)
hi = mi; "mi is larger than target"
else
lo = mi+1; "mi is smaller than target"
} while (lo < hi);
"did not find what we wanted"

The invariants are:

- When entering the loop, 'lo' points at a slot that is never
above the target (it could be at the target), 'hi' points at
a slot that is guaranteed to be above the target (it can
never be at the target).

- We find a point 'mi' between 'lo' and 'hi' ('mi' could be
the same as 'lo', but never can be as high as 'hi'), and
check if 'mi' hits the target. There are three cases:

- if it is a hit, we have found what we are looking for;

- if it is strictly higher than the target, we set it to
'hi', and repeat the search.

- if it is strictly lower than the target, we update 'lo'
to one slot after it, because we allow 'lo' to be at the
target and 'mi' is known to be below the target.

If the loop exits, there is no matching entry.

When choosing 'mi', we do not have to take the "middle" but
anywhere in between 'lo' and 'hi', as long as lo <= mi < hi is
satisfied. When we somehow know that the distance between the
target and 'lo' is much shorter than the target and 'hi', we
could pick 'mi' that is much closer to 'lo' than (hi+lo)/2,
which a conventional binary search would pick.

This patch takes advantage of the fact that the SHA-1 is a good
hash function, and as long as there are enough entries in the
table, we can expect uniform distribution. An entry that begins
with for example "deadbeef..." is much likely to appear much
later than in the midway of a reasonably populated table. In
fact, it can be expected to be near 87% (222/256) from the top
of the table.

This is a work-in-progress and has switches to allow easier
experiments and debugging. Exporting GIT_USE_LOOKUP environment
variable enables this code.

On my admittedly memory starved machine, with a partial KDE
repository (3.0G pack with 95M idx):

$ GIT_USE_LOOKUP=t git log -800 --stat HEAD >/dev/null
3.93user 0.16system 0:04.09elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+55588minor)pagefaults 0swaps

Without the patch, the numbers are:

$ git log -800 --stat HEAD >/dev/null
4.00user 0.15system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+60258minor)pagefaults 0swaps

In the same repository:

$ GIT_USE_LOOKUP=t git log -2000 HEAD >/dev/null
0.12user 0.00system 0:00.12elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+4241minor)pagefaults 0swaps

Without the patch, the numbers are:

$ git log -2000 HEAD >/dev/null
0.05user 0.01system 0:00.07elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+8506minor)pagefaults 0swaps

There isn't much time difference, but the number of minor faults
seems to show that we are touching much smaller number of pages,
which is expected.

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

Merge branch 'jc/rename'Junio C Hamano Wed, 9 Apr 2008 07:46:40 +0000 (00:46 -0700)

Merge branch 'jc/rename'

* 'jc/rename' (early part):
Optimize rename detection for a huge diff

Merge branch 'gp/gitweb'Junio C Hamano Wed, 9 Apr 2008 07:44:48 +0000 (00:44 -0700)

Merge branch 'gp/gitweb'

* gp/gitweb:
gitweb: fallback to system-wide config file (fixup)
gitweb: fallback to system-wide config file if default config does not exist

Merge branch 'mk/unpack-careful'Junio C Hamano Wed, 9 Apr 2008 07:44:17 +0000 (00:44 -0700)

Merge branch 'mk/unpack-careful'

* mk/unpack-careful:
t5300: add test for "index-pack --strict"
receive-pack: allow using --strict mode for unpacking objects
unpack-objects: fix --strict handling
t5300: add test for "unpack-objects --strict"
unpack-objects: prevent writing of inconsistent objects

Merge branch 'fl/send-email-outside'Junio C Hamano Wed, 9 Apr 2008 07:42:23 +0000 (00:42 -0700)

Merge branch 'fl/send-email-outside'

* fl/send-email-outside:
send-email: Don't require to be called in a repository
Git.pm: Don't require repository instance for ident
Git.pm: Don't require a repository instance for config
var: Don't require to be in a git repository.

Merge branch 'jc/rebase'Junio C Hamano Wed, 9 Apr 2008 07:40:46 +0000 (00:40 -0700)

Merge branch 'jc/rebase'

* jc/rebase:
rebase [--onto O] A B: omit needless checkout

Merge branch 'jk/add-i-mode'Junio C Hamano Wed, 9 Apr 2008 07:29:24 +0000 (00:29 -0700)

Merge branch 'jk/add-i-mode'

* jk/add-i-mode:
add--interactive: allow user to choose mode update
add--interactive: ignore mode change in 'p'atch command

Merge branch 'gs/pretty-hexval'Junio C Hamano Wed, 9 Apr 2008 07:18:25 +0000 (00:18 -0700)

Merge branch 'gs/pretty-hexval'

* gs/pretty-hexval:
pretty.c: add %x00 format specifier.

GIT 1.5.5 v1.5.5Junio C Hamano Tue, 8 Apr 2008 04:57:43 +0000 (21:57 -0700)

GIT 1.5.5

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

Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano Tue, 8 Apr 2008 04:52:23 +0000 (21:52 -0700)

Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Fix changing colors through Edit->Preferences

git-svn: fix following renamed paths when tracking... Eric Wong Mon, 7 Apr 2008 07:08:03 +0000 (00:08 -0700)

git-svn: fix following renamed paths when tracking a single path

When using git-svn to follow only a single (empty) path per
svn-remote (i.e. not using --stdlayout), following the history
of a renamed path was broken in
c586879cdfa4f8181a14e953a9152a4639eef333.

This reverts the regression for the single (emtpy) path per
svn-remote case.

To avoid breaking the tests in a committed revision, this is an
addendum to a patch originally submitted by

Santhosh Kumar Mani <santhoshmani@gmail.com>:
> git-svn: add test for renamed directory fetch
>
> This test tries to fetch a directory which had renames in the
> history from a SVN repository.

[ew: unneccesary dependency on the starting an HTTP server
removed from Santhosh's original test.]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-apply-match-beginning'Junio C Hamano Mon, 7 Apr 2008 03:04:29 +0000 (20:04 -0700)

Merge branch 'jc/maint-apply-match-beginning'

* jc/maint-apply-match-beginning:
Fix "git apply" to correctly enforce "match at the beginning"

Add prefix oriented completions for diff and format... Pascal Obry Sun, 6 Apr 2008 16:56:08 +0000 (18:56 +0200)

Add prefix oriented completions for diff and format-patch commands.

Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test suite: remove useless TERM cruft in "t7005-editor.sh"Christian Couder Sun, 6 Apr 2008 17:08:50 +0000 (19:08 +0200)

test suite: remove useless TERM cruft in "t7005-editor.sh"

In commit 15387e3 (Test suite: reset TERM to its previous value after
testing., 2007-10-26), I added a workaround to reset TERM to its previous
value before the "test_done" at the end of "t7005-editor.sh" because
otherwise "test_done" would have printed the test result with a bad TERM
env variable (this resulted in output with no color on konsole).

But since commit c2116a1 (test-lib: fix TERM to dumb for test
repeatability, 2008-03-06), colored output is printed in a subshell with
TERM reset to its original value so the earlier workaround is not needed
anymore.

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

Add interactive option in rebase command completion... Pascal Obry Sun, 6 Apr 2008 17:32:24 +0000 (19:32 +0200)

Add interactive option in rebase command completion list.

Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix "git apply" to correctly enforce "match at the... Junio C Hamano Mon, 7 Apr 2008 02:21:45 +0000 (19:21 -0700)

Fix "git apply" to correctly enforce "match at the beginning"

An earlier commit 4be6096 (apply --unidiff-zero: loosen sanity checks for
--unidiff=0 patches, 2006-09-17) made match_beginning and match_end
computed incorrectly. If a hunk inserts at the beginning, old position
recorded at the hunk is line 0, and if a hunk changes at the beginning, it
is line 1. The new test added to t4104 exposes that the old code did not
insist on matching at the beginning for a patch to add a line to an empty
file.

An even older 65aadb9 (apply: force matching at the beginning.,
2006-05-24) was equally wrong in that it tried to take hints from the
number of leading context lines, to decide if the hunk must match at the
beginning, but we can just look at the line number in the hunk to decide.

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

Add description of OFS_DELTA to the pack format descriptionPeter Eriksen Sun, 6 Apr 2008 20:51:49 +0000 (22:51 +0200)

Add description of OFS_DELTA to the pack format description

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Fix changing colors through Edit->PreferencesGerrit Pape Wed, 26 Mar 2008 18:45:26 +0000 (18:45 +0000)

gitk: Fix changing colors through Edit->Preferences

With tcl/tk8.5 the lset command seems to behave differently. When
changing the background color through Edit->Preferences, the changes
are applied, but new dialogs, such as View->New view... barf with

Error: unknown color name "{#ffffff}"

Additionally when closing gitk, and starting it up again, a bad value
has been saved to ~/.gitk, preventing gitk from running properly; it
fails with

Error in startup script: unknown color name "{#ffffff}"
...

This commit fixes the problem by changing the color dialogs to pass
the empty string {} as the list index to choosecolor. This causes
the lset and lindex commands used by choosecolor to use and set the
whole variable (bgcolor, fgcolor or selectbgcolor) rather than
treating them as a 1-element list. Tested with tcl/tk8.4 and 8.5.

Dmitry Potapov reported this problem through
http://bugs.debian.org/472615

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

git-pack-objects.txt: Make wording slightly less ambiguousPeter Eriksen Sat, 5 Apr 2008 19:46:49 +0000 (21:46 +0200)

git-pack-objects.txt: Make wording slightly less ambiguous

It is a bit confusing on first read, that

"The packed archive format (.pack) is designed
to be unpackable..."

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-fetch: Don't trigger a bus error when given the... Kevin Ballard Sat, 5 Apr 2008 18:28:53 +0000 (14:28 -0400)

git-fetch: Don't trigger a bus error when given the refspec "tag"

When git-fetch encounters the refspec "tag" it assumes that the next
argument will be a tag name. If there is no next argument, it should
die gracefully instead of erroring.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "gitweb: Add 'status_str' to parse_difftree_raw_... Jakub Narebski Sat, 5 Apr 2008 20:13:24 +0000 (21:13 +0100)

Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output"

This reverts commit 6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab.

It caused is_deleted() subroutine to output warnings when dealing with
old, legacy gitweb blobdiff URLs without either 'hb' or 'hpb'
parameters.

This fixes http://bugs.debian.org/469083

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: fallback to system-wide config file (fixup)Gerrit Pape Sat, 5 Apr 2008 16:37:18 +0000 (16:37 +0000)

gitweb: fallback to system-wide config file (fixup)

The earlier one did not correctly propagate GITWEB_CONFIG_SYSTEM from
Makefile to generated gitweb.cgi script.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://repo.or.cz/git-guiJunio C Hamano Sat, 5 Apr 2008 05:38:32 +0000 (22:38 -0700)

Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
git-gui: use +/- instead of ]/[ to show more/less context in diff
git-gui: Update french translation
git-gui: Switch keybindings for [ and ] to bracketleft and bracketright

git-gui: use +/- instead of ]/[ to show more/less conte... gitgui-0.10.1Michele Ballabio Fri, 4 Apr 2008 21:04:42 +0000 (23:04 +0200)

git-gui: use +/- instead of ]/[ to show more/less context in diff

On some systems, brackets cannot be used as event details
(they don't have a keysym), so use +/- instead (both on
keyboard and keypad) and add ctrl-= as a synonym of ctrl-+
for convenience.

[sp: Had to change accelerator to show only "$M1T-="; the
original version included "$M1T-+ $M1T-=" but this is
not drawn at all on Mac OS X.]

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Update french translationChristian Couder Sat, 5 Apr 2008 02:20:23 +0000 (04:20 +0200)

git-gui: Update french translation

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Switch keybindings for [ and ] to bracketleft... Shawn O. Pearce Thu, 3 Apr 2008 22:06:29 +0000 (18:06 -0400)

git-gui: Switch keybindings for [ and ] to bracketleft and bracketright

Thanks to Michele Ballabio for the quick fix.
This resolves the error introduced by c91ee2bd61.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

GIT 1.5.5-rc3 v1.5.5-rc3Junio C Hamano Wed, 2 Apr 2008 17:42:14 +0000 (10:42 -0700)

GIT 1.5.5-rc3

The rate of fixes that trickle in has slowed and we are definitely
getting there. Hopefully one final round and we will have the final
1.5.5 soon.

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

Merge branch 'js/filter-branch'Junio C Hamano Wed, 2 Apr 2008 18:13:23 +0000 (11:13 -0700)

Merge branch 'js/filter-branch'

* js/filter-branch:
filter-branch: Fix renaming a directory in the tree-filter
filter-branch: Test renaming directories in a tree-filter

Describe the bug in handling filenames with funny chara... Teemu Likonen Wed, 2 Apr 2008 17:06:46 +0000 (20:06 +0300)

Describe the bug in handling filenames with funny characters in 'git add -i'

The interactive mode does not work with files whose names contain
characters that need C-quoting. `core.quotepath` configuration can be
used to work this limitation around to some degree, but backslash,
double-quote and control characters will still have problems.

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

Merge git://repo.or.cz/git-guiJunio C Hamano Wed, 2 Apr 2008 17:29:10 +0000 (10:29 -0700)

Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
git-gui 0.10
git-gui: Add shortcut keys for Show More/Less Context

Merge branch 'bc/mktag'Junio C Hamano Wed, 2 Apr 2008 07:23:19 +0000 (00:23 -0700)

Merge branch 'bc/mktag'

* bc/mktag:
mktag.c: tweak validation of tagger field and adjust test script
mktag.c: improve verification of tagger field and tests

Merge branch 'pb/cvsserver'Junio C Hamano Wed, 2 Apr 2008 07:22:20 +0000 (00:22 -0700)

Merge branch 'pb/cvsserver'

* pb/cvsserver:
git-cvsserver: handle change type T

Merge branch 'dd/cvsserver'Junio C Hamano Wed, 2 Apr 2008 07:22:15 +0000 (00:22 -0700)

Merge branch 'dd/cvsserver'

* dd/cvsserver:
cvsserver: Use the user part of the email in log and annotate results
cvsserver: Add test for update -p
cvsserver: Implement update -p (print to stdout)
cvsserver: Add a few tests for 'status' command
cvsserver: Do not include status output for subdirectories if -l is passed
cvsserver: Only print the file part of the filename in status header
cvsserver: Respond to the 'editors' and 'watchers' commands

Merge branch 'je/cvsserver'Junio C Hamano Wed, 2 Apr 2008 07:22:06 +0000 (00:22 -0700)

Merge branch 'je/cvsserver'

* je/cvsserver:
Allow git-cvsserver database table name prefix to be specified.

t7004-tag: Skip more tests if gpg is not available.Johannes Sixt Wed, 2 Apr 2008 06:52:37 +0000 (08:52 +0200)

t7004-tag: Skip more tests if gpg is not available.

This test was already careful enough to skip signed tag tests if gpg
is not available, but it must also skip all verify tests, even those
that are about non-signed tags, because they also invoke gpg.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify-tag: Clean up the temporary file if gpg cannot... Johannes Sixt Wed, 2 Apr 2008 06:49:59 +0000 (08:49 +0200)

verify-tag: Clean up the temporary file if gpg cannot be started.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help: Add a missing OPT_END().Christian Couder Wed, 2 Apr 2008 03:47:41 +0000 (05:47 +0200)

help: Add a missing OPT_END().

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

Accept git aliases outside a git repositoryJunio C Hamano Tue, 1 Apr 2008 04:33:09 +0000 (21:33 -0700)

Accept git aliases outside a git repository

af05d67 (Always set *nongit_ok in setup_git_directory_gently(),
2008-03-25) had a change from the patch originally submitted that resulted
in disabling aliases outside a git repository.

It turns out that some people used "alias.fubar = diff --color-words" in
$HOME/.gitconfig to use non-index diff (or any command that do not need
git repository) outside git repositories, and this change broke them,
so this resurrects the support for such usage.

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

git-gui 0.10 gitgui-0.10.0Shawn O. Pearce Wed, 2 Apr 2008 06:17:11 +0000 (02:17 -0400)

git-gui 0.10

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Add shortcut keys for Show More/Less ContextJonathan del Strother Tue, 1 Apr 2008 10:54:03 +0000 (11:54 +0100)

git-gui: Add shortcut keys for Show More/Less Context

Bound to Ctrl/Cmd + left & right square brackets, depending on
your platform.

[sp: Added missing binds for . to allow shortcuts to work when
not focused in the commit message area.]

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

mktag.c: tweak validation of tagger field and adjust... Brandon Casey Mon, 31 Mar 2008 23:25:23 +0000 (18:25 -0500)

mktag.c: tweak validation of tagger field and adjust test script

Update the verify_tag() function to remove an unnecessary test, and add
additional check for angle brackets in the name and email field, and
spaces in the email field. The timestamp and timezone sections are made
more straight forward by using strspn().

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: Fix renaming a directory in the tree... veillette@yahoo.ca Mon, 31 Mar 2008 07:14:15 +0000 (09:14 +0200)

filter-branch: Fix renaming a directory in the tree-filter

Commit d89c1df (filter-branch: don't use xargs -0, 2008-03-12) replaced a
'ls-files | xargs rm' pipeline by 'git clean'. 'git clean' however does
not recurse and remove directories by default.

Now, consider a tree-filter that renames a directory.

1. For the first commit everything works as expected

2. Then filter-branch checks out the files for the next commit. This
leaves the new directory behind because there is no real "branch
switching" involved that would notice that the directory can be
removed.

3. Then filter-branch invokes 'git clean' to remove exactly those
left-overs. But here it does not remove the directory.

4. The next tree-filter does not work as expected because there already
exists a directory with the new name.

Just add -d to 'git clean', so that empty directories are removed.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: Test renaming directories in a tree... Johannes Sixt Mon, 31 Mar 2008 07:14:14 +0000 (09:14 +0200)

filter-branch: Test renaming directories in a tree-filter

This test currently fails.

If b is a directory then 'mv a b' is not a plain "rename", but really a
"move", so we must also test that the directory does not exist with the
old name in the directory with the new name.

There's also some cleanup in the corresponding "rename file" test to avoid
spurious shell syntax errors and "ambigous ref" error from 'git show' (but
these should show up only if the test would fail anyway). Plus we also
test for the non-existence of the old file.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>

mktag.c: improve verification of tagger field and testsBrandon Casey Thu, 27 Mar 2008 16:16:04 +0000 (11:16 -0500)

mktag.c: improve verification of tagger field and tests

Since nearly its birth, git's tags have included a "tagger" field which
describes the name of tagger, email of tagger, and date and time of tagging.
But, this field was only loosely tested by git-mktag. Provide some thorough
testing for this field and also ensure that the tag header is separated
from the tag body by an empty line to reduce the convenience of creating
a flawed tag.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-files: careful when inspecting work tree itemsJunio C Hamano Mon, 31 Mar 2008 00:30:08 +0000 (17:30 -0700)

diff-files: careful when inspecting work tree items

This fixes the same breakage in diff-files.

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

diff-index: careful when inspecting work tree itemsJunio C Hamano Mon, 31 Mar 2008 00:29:48 +0000 (17:29 -0700)

diff-index: careful when inspecting work tree items

Earlier, if you changed a staged path into a directory in the work tree,
we happily ran lstat(2) on it and found that it exists, and declared that
the user changed it to a gitlink.

This is wrong for two reasons:

(1) It may be a directory, but it may not be a submodule, and in the
latter case, the change we need to report is "the blob at the path
has disappeared". We need to check with resolve_gitlink_ref() to be
consistent with what "git add" and "git update-index --add" does.

(2) lstat(2) may have succeeded only because a leading component of the
path was turned into a symbolic link that points at something that
exists in the work tree. In such a case, the path itself does not
exist anymore, as far as the index is concerned.

This fixes these breakages in diff-index that the previous patch has
exposed.

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

Add corner case tests for diff-index and diff-filesJunio C Hamano Mon, 31 Mar 2008 00:28:05 +0000 (17:28 -0700)

Add corner case tests for diff-index and diff-files

diff-index and diff-files can get confused in corner cases when an indexed
blob turns into something else in the work tree. This patch adds tests to
expose such breakages.

The test is classified under t2XXX series instead of t4XXX series, because
the ultimate objective is to fix "add -u" (and "commit -a" that shares the
same issue).

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

Allow git-cvsserver database table name prefix to be... Josh Elsasser Thu, 27 Mar 2008 21:02:14 +0000 (14:02 -0700)

Allow git-cvsserver database table name prefix to be specified.

Adds a gitcvs.dbtablenameprefix config variable, the contents of which
are prepended to any database tables names used by git-cvsserver. The
same substutions as gitcvs.dbname and gitcvs.dbuser are supported, and
any non-alphabetic characters are replaced with underscores.

A typo found in contrib/completion/git-completion.bash is also fixed.

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

Silence cpio's "N blocks" output when cloning locallyBryan Donlan Fri, 28 Mar 2008 06:19:46 +0000 (02:19 -0400)

Silence cpio's "N blocks" output when cloning locally

Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" message.
For compatibility with operating systems which might not support GNUisms,
the presence of --quiet is probed for by grepping cpio's --help output.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: remove redundant slashes from show-ignoreEric Wong Sat, 29 Mar 2008 23:37:17 +0000 (16:37 -0700)

git-svn: remove redundant slashes from show-ignore

Jonathan Scott Duff wrote:

> Recently I tried "git svn showignore" on my parrot repository and it
> failed. I tracked it down to the prop_walk() sub. When it recurses,
> $path has an extra / on the beginning (i.e., when it recurses, it
> tries to get the props for "//apps" instead of "/apps"). I *think*
> this is because $path is used in the recursive call rather than $p
> (which seems to contain a properly transformed $path). Anyway, I've
> attached a patch that works for me and I think is generally the right
> thing.

Patch-submitted-by: Jonathan Scott Duff
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Handle Windows EOLs properly after removal... Marius Storm-Olsen Fri, 28 Mar 2008 14:40:40 +0000 (15:40 +0100)

git-p4: Handle Windows EOLs properly after removal of p4 submit template handling.

git-p4s handling of Windows style EOL was broken after the removal
of the p4 submit template handling in commit f2a6059. Fix that, and
make getP4OpenedType() more robust.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Simon Hausmann <simon@lst.de>

git-cvsserver: handle change type TPaolo Bonzini Sun, 16 Mar 2008 19:00:21 +0000 (20:00 +0100)

git-cvsserver: handle change type T

git-cvsserver does not support changes of type T (file type change,
e.g. symlink->real file). This patch treats them the same as changes
of type M.

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

GIT 1.5.5-rc2 v1.5.5-rc2Junio C Hamano Fri, 28 Mar 2008 03:43:51 +0000 (20:43 -0700)

GIT 1.5.5-rc2

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

GIT 1.5.4.5 v1.5.4.5Junio C Hamano Fri, 28 Mar 2008 03:36:35 +0000 (20:36 -0700)

GIT 1.5.4.5

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

cvsserver: Use the user part of the email in log and... Damien Diederen Thu, 27 Mar 2008 22:18:35 +0000 (23:18 +0100)

cvsserver: Use the user part of the email in log and annotate results

Generate the CVS author names by taking the first eight characters of
the user part of the email address. The resulting names are more
likely to make sense (or at least reduce ambiguities) in "corporate"
environments.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Add test for update -pDamien Diederen Thu, 27 Mar 2008 22:18:23 +0000 (23:18 +0100)

cvsserver: Add test for update -p

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Implement update -p (print to stdout)Damien Diederen Thu, 27 Mar 2008 22:18:12 +0000 (23:18 +0100)

cvsserver: Implement update -p (print to stdout)

Cvs update -p -r <rev> <path> is the documented way to retrieve a
specific revision of a file (similar to git show <rev>:<path>).
Without this patch, the -p flag is ignored and status output is
produced, causing clients to interpret it as the contents of the file.

TkCVS uses update -p as a basis for implementing its various "View"
and "Diff" commands.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Add a few tests for 'status' commandDamien Diederen Thu, 27 Mar 2008 22:18:02 +0000 (23:18 +0100)

cvsserver: Add a few tests for 'status' command

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Do not include status output for subdirector... Damien Diederen Thu, 27 Mar 2008 22:17:53 +0000 (23:17 +0100)

cvsserver: Do not include status output for subdirectories if -l is passed

This effectively implements the -l switch by pruning the entries whose
filenames contain a path separator. It was previously ignored.

Without this, TkCVS includes strange "ghost" entries in its directory
listings.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Only print the file part of the filename... Damien Diederen Thu, 27 Mar 2008 22:17:42 +0000 (23:17 +0100)

cvsserver: Only print the file part of the filename in status header

The "File:" header of CVS status output only includes the basename of
the file, even when generating a recursive listing; do the same.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsserver: Respond to the 'editors' and 'watchers'... Damien Diederen Thu, 27 Mar 2008 22:17:26 +0000 (23:17 +0100)

cvsserver: Respond to the 'editors' and 'watchers' commands

These commands list users editing and watching locked files. This trivial
implementation always returns an empty response, since git-cvsserver does not
implement file locking.

Without this, TkCVS hangs at startup, waiting forever for a response.

Signed-off-by: Damien Diederen <dash@foobox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-prune: protect objects listed on the command... Junio C Hamano Tue, 25 Mar 2008 06:20:51 +0000 (23:20 -0700)

builtin-prune: protect objects listed on the command line

Finally, this resurrects the documented behaviour to protect other
objects listed on the command line from getting pruned.

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

builtin-prune.c: use parse_options()Michele Ballabio Sun, 23 Mar 2008 20:50:29 +0000 (21:50 +0100)

builtin-prune.c: use parse_options()

Using the OPT_DATE() introduced earlier, this updates builtin-prune to
use parse_options().

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add tests for git-pruneMichele Ballabio Sun, 23 Mar 2008 21:34:34 +0000 (22:34 +0100)

Add tests for git-prune

It seems that git prune changed behaviour with respect to revisions added
from command line, probably when it became a builtin. Currently, it prints
a short usage and exits: instead, it should take those revisions into
account and not prune them. So add a couple of test to point this out.

We'll be fixing this by switching to parse_options(), so add tests to
detect bogus command line parameters as well, to keep ourselves from
introducing regressions.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options.c: introduce OPT_DATEMichele Ballabio Mon, 24 Mar 2008 14:02:21 +0000 (15:02 +0100)

parse-options.c: introduce OPT_DATE

There are quite a few places that will need to call approxidate(),
when they'll adopt the parse-options system, so this patch adds the
function parse_opt_approxidate_cb(), used by OPT_DATE.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: fallback to system-wide config file if default... Gerrit Pape Wed, 26 Mar 2008 18:11:19 +0000 (18:11 +0000)

gitweb: fallback to system-wide config file if default config does not exist

From a distribution point of view, configuration files for applications
should reside in /etc/. On the other hand it's convenient for multiple
instances of gitweb (e.g. virtual web servers on a single machine) to have
a per-instance configuration file, just as gitweb currently supports
through the file gitweb_config.perl next to the cgi.

To support both at runtime, this commit introduces GITWEB_CONFIG_SYSTEM as
a system-wide configuration file which will be used as a fallback if the
config file sprecified throug GITWEB_CONFIG does not exist.

See also
http://bugs.debian.org/450592

Signed-off-by: Gerrit Pape <pape@smarden.org>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add--interactive: allow user to choose mode updateJeff King Thu, 27 Mar 2008 07:32:25 +0000 (03:32 -0400)

add--interactive: allow user to choose mode update

When using the 'p'atch command, instead of just throwing out any mode
change, present it to the user in the same way that we show hunks.

This way, the mode change can be staged independently from the changes
to the contents.

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

add--interactive: ignore mode change in 'p'atch commandJeff King Thu, 27 Mar 2008 07:30:43 +0000 (03:30 -0400)

add--interactive: ignore mode change in 'p'atch command

When a path is examined in the patch subcommand, any mode changes in
the file are given to use in the diff header by git-diff. If no hunks
are staged, then we throw out that header and do not touch the
path. But if _any_ hunks are staged, we use the header, and the mode
is changed together with the contents.

Since the 'p'atch command should just be dealing with hunks that are
shown to the user, it makes sense to just ignore mode changes
entirely. We do squirrel away the mode, though, since the next patch
will allow users to select the mode update separately.

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

Update draft release notes for 1.5.5Junio C Hamano Thu, 27 Mar 2008 20:37:29 +0000 (13:37 -0700)

Update draft release notes for 1.5.5

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

Merge branch 'maint'Junio C Hamano Thu, 27 Mar 2008 20:35:18 +0000 (13:35 -0700)

Merge branch 'maint'

* maint:
Update draft release notes for 1.5.4.5
Documentation: clarify use of .git{ignore,attributes} versus .git/info/*
t/t3800-mktag.sh: use test_must_fail rather than '!'

Conflicts:

t/t3800-mktag.sh

Update draft release notes for 1.5.4.5Junio C Hamano Thu, 27 Mar 2008 20:14:20 +0000 (13:14 -0700)

Update draft release notes for 1.5.4.5

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

Merge branch 'jc/maint-fetch-regression-1.5.4' into... Junio C Hamano Thu, 27 Mar 2008 20:03:56 +0000 (13:03 -0700)

Merge branch 'jc/maint-fetch-regression-1.5.4' into maint

* jc/maint-fetch-regression-1.5.4:
git-fetch test: test tracking fetch results, not just FETCH_HEAD
Fix branches file configuration
Tighten refspec processing

Documentation: clarify use of .git{ignore,attributes... Jeff King Thu, 27 Mar 2008 05:31:00 +0000 (01:31 -0400)

Documentation: clarify use of .git{ignore,attributes} versus .git/info/*

gitignore patterns can be read from three different
files, while gitattributes can come from two files. Let's
provide some hints to the user about the differences and how
they are typically used.

Suggested by Toby Corkindale, but gratuitously reworded by Jeff King.

Signed-off-by: Toby Corkindale <toby.corkindale@rea-group.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_must_fail: 129 is a valid error code from usage()Junio C Hamano Tue, 25 Mar 2008 06:07:08 +0000 (23:07 -0700)

test_must_fail: 129 is a valid error code from usage()

When a git command is run under test_must_fail to make sure that
the argument parser catches bogus command line, it exits with 129.
We need to catch it as a valid "graceful error exit".

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

imap-send: properly error out if imap.host is not set... Gerrit Pape Wed, 26 Mar 2008 18:05:17 +0000 (18:05 +0000)

imap-send: properly error out if imap.host is not set in config

If no imap host is specified in the git config, git imap-send used
to try to lookup a null pointer through gethostbyname(), causing a
segfault. Since setting the imap.host variable is mandatory,
imap-send now properly fails with an explanatory error message.

The problem has been reported by picca through
http://bugs.debian.org/472632

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9600-cvsimport.sh: set HOME before checking for cvsps... Frank Lichtenheld Wed, 26 Mar 2008 17:34:20 +0000 (17:34 +0000)

t9600-cvsimport.sh: set HOME before checking for cvsps availability

This actually sounds like a bug in cvsps, which requires an existing
home directory when asked for the usage through -h

$ HOME=/nonexistent cvsps -h
Cannot create the cvsps directory '.cvsps': No such file or directory

This made t9600 think that cvsps is not available if HOME did not exist,
causing the tests to be skipped

$ HOME=/nonexistent sh t9600-cvsimport.sh
* skipping cvsimport tests, cvsps not found
* passed all 0 test(s)

Now t9600 sets HOME to the current working directory before checking for
the availability of the cvsps program.

This issue has been discovered by Marco Rodrigues, and fixed by Frank
Lichtenheld through
http://bugs.debian.org/471969

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Always set *nongit_ok in setup_git_directory_gently()SZEDER Gábor Tue, 25 Mar 2008 21:06:26 +0000 (22:06 +0100)

Always set *nongit_ok in setup_git_directory_gently()

setup_git_directory_gently() only modified the value of its *nongit_ok
argument if we were not in a git repository. Now it will always set it
to 0 when we are inside a repository.

Also remove now unnecessary initializations in the callers of this
function.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t3800-mktag.sh: use test_must_fail rather than '!'Brandon Casey Wed, 26 Mar 2008 00:20:52 +0000 (19:20 -0500)

t/t3800-mktag.sh: use test_must_fail rather than '!'

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

Merge branch 'jc/maint-fetch-regression-1.5.4'Junio C Hamano Wed, 26 Mar 2008 08:49:41 +0000 (01:49 -0700)

Merge branch 'jc/maint-fetch-regression-1.5.4'

* jc/maint-fetch-regression-1.5.4:
git-fetch test: test tracking fetch results, not just FETCH_HEAD
Fix branches file configuration
Tighten refspec processing
Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.

git-fetch test: test tracking fetch results, not just... Junio C Hamano Wed, 26 Mar 2008 08:17:07 +0000 (01:17 -0700)

git-fetch test: test tracking fetch results, not just FETCH_HEAD

We really should have done this long time ago. Existing t5515 test
was written for the specific purpose of catching regression to the
contents of generated FETCH_HEAD file, but it also is a good place
to make sure various fetch configurations do fetch what they intend
to fetch (and nothing else).

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

Fix branches file configurationDaniel Barkalow Tue, 25 Mar 2008 23:35:28 +0000 (19:35 -0400)

Fix branches file configuration

Fetched remote branch from .git/branches/foo should fetch into
refs/heads/foo. Also when partial URL is given, the fetched head should
always be remote HEAD, and the result should not be stored anywhere.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tighten refspec processingDaniel Barkalow Tue, 18 Mar 2008 02:05:23 +0000 (22:05 -0400)

Tighten refspec processing

This changes the pattern matching code to not store the required final
/ before the *, and then to require each side to be a valid ref (or
empty). In particular, any refspec that looks like it should be a
pattern but doesn't quite meet the requirements will be found to be
invalid as a fallback non-pattern.

This was cherry picked from commit ef00d15 (Tighten refspec processing,
2008-03-17), and two fix-up commits 46220ca (remote.c: Fix overtight
refspec validation, 2008-03-20) and 7d19da4 (refspec: allow colon-less
wildcard "refs/category/*", 2008-03-25) squashed in.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix the wrong output of `git-show v1.3.0~155^2~4` in... Guanqun Lu Mon, 24 Mar 2008 07:27:28 +0000 (15:27 +0800)

Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.

Texts between ~ and ~ will be subscripted during the asciidoc translation.

Signed-off-by: Guanqun Lu <Guanqun.Lu@Gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
(cherry picked from commit 0c829391cfcdc57172765322575804a7ad5f3116)

refspec: allow colon-less wildcard "refs/category/*"Junio C Hamano Wed, 26 Mar 2008 04:15:52 +0000 (21:15 -0700)

refspec: allow colon-less wildcard "refs/category/*"

"git push --tags elsewhere" is implemented in terms of wildcarded refspec
"refs/tags/*" these days, and the user wants to push the tags under the
same name to the other branch. This resurrects the support for it.

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

init: show "Reinit" message even in an (existing) empty... Johannes Schindelin Mon, 24 Mar 2008 15:14:52 +0000 (16:14 +0100)

init: show "Reinit" message even in an (existing) empty repository

Earlier, git-init tested for a valid HEAD ref, but if the repository
was empty, there was none. Instead, test for the existence of
the file $GIT_DIR/HEAD.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-checkout: Update summary to reflect... Julian Phillips Mon, 24 Mar 2008 03:06:20 +0000 (03:06 +0000)

Documentation/git-checkout: Update summary to reflect current abilities

For a while now, git-checkout has been more powerful than the man-page
summary would suggest (the main text does describe the new features),
so update the summary to hopefully better reflect the current
functionality. Also update the glossary description of the word checkout.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-tag '-m'/'-F' implies '-a'Dirk Süsserott Mon, 24 Mar 2008 19:43:08 +0000 (15:43 -0400)

Documentation: git-tag '-m'/'-F' implies '-a'

builtin-remote: Fix missing newline at end of listing... Johannes Sixt Tue, 18 Mar 2008 20:52:00 +0000 (21:52 +0100)

builtin-remote: Fix missing newline at end of listing of pushed branches

Without this the output of 'git remote show' does not end with a new-line:

bash> git remote show repo
* remote repo
URL: repo.or.cz:/srv/git/kdbg.git
Tracked remote branches
maint master mob
Local branch pushed with 'git push'
+master:masterbash>

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix the wrong output of `git-show v1.3.0~155^2~4` in... Guanqun Lu Mon, 24 Mar 2008 07:27:28 +0000 (15:27 +0800)

Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.

Texts between ~ and ~ will be subscripted during the asciidoc translation.

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

RelNotes: mention checkout/branch's --track option... Johannes Schindelin Sun, 23 Mar 2008 11:35:37 +0000 (12:35 +0100)

RelNotes: mention checkout/branch's --track option, too

checkout and branch recently learnt to track local branches when
branch.autosetupmerge = always, but they _also_ learnt to do that when
asked explicitely with the option "--track".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty.c: add %x00 format specifier.Govind Salinas Fri, 21 Mar 2008 15:05:06 +0000 (10:05 -0500)

pretty.c: add %x00 format specifier.

This adds a %xXX format which inserts two hexdigits after %x as a byte
value in the resulting string. This can be used to add a NUL byte or any
other byte that can make machine parsing easier. It is also necessary to
use fwrite to print out the data since printf will terminate if you feed
it a NUL.

Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

GIT 1.5.5-rc1 v1.5.5-rc1Junio C Hamano Sun, 23 Mar 2008 07:21:48 +0000 (00:21 -0700)

GIT 1.5.5-rc1

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

gc --auto: raise default auto pack limit from 20 to 50Junio C Hamano Sun, 23 Mar 2008 07:04:48 +0000 (00:04 -0700)

gc --auto: raise default auto pack limit from 20 to 50

Recent discussion on the list, with the improvement f7c22cc (always start
looking up objects in the last used pack first, 2007-05-30) brought in,
reached the concensus that the current default 20 is too low.

Reference: http://thread.gmane.org/gmane.comp.version-control.git/77586
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'git-p4' of git://repo.or.cz/git/git-p4Junio C Hamano Sun, 23 Mar 2008 07:02:06 +0000 (00:02 -0700)

Merge branch 'git-p4' of git://repo.or.cz/git/git-p4

* 'git-p4' of git://repo.or.cz/git/git-p4:
git-p4: Use P4EDITOR environment variable when set
git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
git-p4: Optimize the fetching of data from perforce.

remote.c: Fix overtight refspec validationJunio C Hamano Fri, 21 Mar 2008 06:34:37 +0000 (23:34 -0700)

remote.c: Fix overtight refspec validation

We tightened the refspec validation code in an earlier commit ef00d15
(Tighten refspec processing, 2008-03-17) per my suggestion, but the
suggestion was misguided to begin with and it broke this usage:

$ git push origin HEAD~12:master

The syntax of push refspecs and fetch refspecs are similar in that they
are both colon separated LHS and RHS (possibly prefixed with a + to
force), but the similarity ends there. For example, LHS in a push refspec
can be anything that evaluates to a valid object name at runtime (except
when colon and RHS is missing, or it is a glob), while it must be a
valid-looking refname in a fetch refspec. To validate them correctly, the
caller needs to be able to say which kind of refspecs they are. It is
unreasonable to keep a single interface that cannot tell which kind it is
dealing with, and ask it to behave sensibly.

This commit separates the parsing of the two into different functions, and
clarifies the code to implement the parsing proper (i.e. splitting into
two parts, making sure both sides are wildcard or neither side is).

This happens to also allow pushing a commit named with the esoteric "look
for that string" syntax:

$ git push ../test.git ':/remote.c: Fix overtight refspec:master'

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

fast-import: Document the effect of "merge" with no... Eyvind Bernhardsen Fri, 21 Mar 2008 15:25:18 +0000 (16:25 +0100)

fast-import: Document the effect of "merge" with no "from" in a commit

The fast-import documentation currently does not document the behaviour
of "merge" when there is no "from" in a commit. This patch adds a
description of what happens: the commit is created with a parent, but
no files. This behaviour is equivalent to "from" followed by
"filedeleteall".

Signed-off-by: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make git-svn tests behave better on OS XKevin Ballard Fri, 21 Mar 2008 07:27:35 +0000 (03:27 -0400)

Make git-svn tests behave better on OS X

Give lib-git-svn.sh a few alternate paths to look for apache2.
Explicitly define the LockFile so httpd will actually start under OS X

Signed-off-by: Kevin Ballard <kevin@sb.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve description of git filter-branch.Ralf Wildenhues Thu, 20 Mar 2008 21:30:32 +0000 (22:30 +0100)

Improve description of git filter-branch.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7003-filter-branch.sh: use test_must_fail rather... Brandon Casey Thu, 20 Mar 2008 16:54:30 +0000 (11:54 -0500)

t/t7003-filter-branch.sh: use test_must_fail rather than '!'

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>