Code

git.git
15 years agoGIT 1.5.6.6 v1.5.6.6
Junio C Hamano [Wed, 17 Dec 2008 06:13:36 +0000 (22:13 -0800)]
GIT 1.5.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.5.6 v1.5.5.6
Junio C Hamano [Wed, 17 Dec 2008 06:08:22 +0000 (22:08 -0800)]
GIT 1.5.5.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.4.7 v1.5.4.7
Junio C Hamano [Wed, 17 Dec 2008 06:03:29 +0000 (22:03 -0800)]
GIT 1.5.4.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: do not run "git diff" that is Porcelain
Junio C Hamano [Wed, 17 Dec 2008 03:42:02 +0000 (19:42 -0800)]
gitweb: do not run "git diff" that is Porcelain

Jakub says that legacy-style URI to view two blob differences are never
generated since 1.4.3.  This codepath runs "git diff" Porcelain from the
gitweb, which is a no-no.  It can trigger diff.external command that is
specified in the configuration file of the repository being viewed.

This patch applies to v1.5.4 and later.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5304-prune: adjust file mtime based on system time rather than file mtime
Brandon Casey [Thu, 14 Aug 2008 00:49:30 +0000 (19:49 -0500)]
t5304-prune: adjust file mtime based on system time rather than file mtime

test-chmtime can adjust the mtime of a file based on the file's mtime, or
based on the system time. For files accessed over NFS, the file's mtime is
set by the NFS server, and as such may vary a great deal from the NFS
client's system time if the clocks of the client and server are out of
sync. Since these tests are testing the expire feature of git-prune, an
incorrect mtime could cause a file to be expired or not expired incorrectly
and produce a test failure.

Avoid this NFS pitfall by modifying the calls to test-chmtime so that the
mtime is adjusted based on the system time, rather than the file's mtime.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix escaping of glob special characters in pathspecs
Kevin Ballard [Wed, 13 Aug 2008 22:34:34 +0000 (15:34 -0700)]
Fix escaping of glob special characters in pathspecs

match_one implements an optimized pathspec match where it only uses
fnmatch if it detects glob special characters in the pattern. Unfortunately
it didn't treat \ as a special character, so attempts to escape a glob
special character would fail even though fnmatch() supports it.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDo not talk about "diff" in rev-list documentation.
Junio C Hamano [Mon, 11 Aug 2008 18:46:56 +0000 (11:46 -0700)]
Do not talk about "diff" in rev-list documentation.

Since 8c02eee (git-rev-list(1): group options; reformat; document more
options, 2006-09-01), git-rev-list documentation talks as if it supports
any kind of diff output.  It doesn't.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-bisect: fix wrong usage of read(1)
Francis Moreau [Mon, 11 Aug 2008 17:37:46 +0000 (19:37 +0200)]
git-bisect: fix wrong usage of read(1)

Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRe-fix rev-list-options documentation
Junio C Hamano [Mon, 11 Aug 2008 21:24:51 +0000 (14:24 -0700)]
Re-fix rev-list-options documentation

18a2197 (Documentation: rev-list-options: Fix -g paragraph formatting,
2008-08-10) introduced the third paragraph that is continued, but it seems
to confuse docbook toolchain on FC9 machines.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix invalid reference to 'mybranch' in user manual
Ivan Stankovic [Sun, 10 Aug 2008 16:22:14 +0000 (18:22 +0200)]
Documentation: fix invalid reference to 'mybranch' in user manual

Signed-off-by: Ivan Stankovic <pokemon@fly.srk.fer.hr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix deleting reflog entries from HEAD reflog
Junio C Hamano [Mon, 11 Aug 2008 06:21:25 +0000 (23:21 -0700)]
Fix deleting reflog entries from HEAD reflog

dwim_ref() used to resolve HEAD symbolic ref to its target (i.e. current
branch).  This incorrectly removed the reflog entry from the current
branch when 'git reflog delete HEAD@{1}' was asked for.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoreflog test: add more tests for 'reflog delete'
Pieter de Bie [Sat, 9 Aug 2008 23:33:29 +0000 (01:33 +0200)]
reflog test: add more tests for 'reflog delete'

This adds more tests for 'reflog delete' and marks it as
broken, as currently a call to 'git reflog delete HEAD@{1}'
deletes entries in the currently checked out branch's log,
not the HEAD log.

Noticed by John Wiegley

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: rev-list-options: Fix -g paragraph formatting
Thomas Rast [Sun, 10 Aug 2008 13:04:34 +0000 (15:04 +0200)]
Documentation: rev-list-options: Fix -g paragraph formatting

- Add an escape to @{now}.  Without the escape, the brace does
  something magic and eats half the sentence up to the closing brace
  at 'timestamp}'.

- Join the last paragraph with a '+'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoasciidoc markup fixes
Junio C Hamano [Thu, 7 Aug 2008 23:05:25 +0000 (16:05 -0700)]
asciidoc markup fixes

I see quite a few pages on k.org site, e.g.

    http://www.kernel.org/pub/software/scm/git/docs/git-rerere.html
    (scroll down to find "After this test merge")

are misformatted to lose teletype text '+' that is followed by a comma,
and turns the following paragraph all typeset in teletype.

This patch seems to fix the issue at the site (meaning, with the
particular vintage of asciidoc and docbook toolchain), without breaking
things with the version I have at my primary development machine, but
wider testing is very much appreciated.

After this patch,

    git grep '`+`,' -- Documentation

should report noting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'lt/config-fsync' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:56:23 +0000 (18:56 -0700)]
Merge branch 'lt/config-fsync' into maint

* lt/config-fsync:
  Add config option to enable 'fsync()' of object files
  Split up default "i18n" and "branch" config parsing into helper routines
  Split up default "user" config parsing into helper routine
  Split up default "core" config parsing into helper routine

15 years agoMerge branch 'jc/reflog-expire' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:52:50 +0000 (18:52 -0700)]
Merge branch 'jc/reflog-expire' into maint

* jc/reflog-expire:
  Make default expiration period of reflog used for stash infinite
  Per-ref reflog expiry configuration

15 years agoMerge branch 'ag/rewrite_one' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:48:32 +0000 (18:48 -0700)]
Merge branch 'ag/rewrite_one' into maint

* ag/rewrite_one:
  Fix quadratic performance in rewrite_one.

15 years agoFail properly when cloning from invalid HTTP URL
Petr Baudis [Thu, 7 Aug 2008 00:06:30 +0000 (02:06 +0200)]
Fail properly when cloning from invalid HTTP URL

Currently, when cloning from invalid HTTP URL, git clone will possibly
return curl error, then a confusing message about remote HEAD and then
return success and leave an empty repository behind, confusing either
the end-user or the automated service calling it (think repo.or.cz).

This patch changes the error() calls in get_refs_via_curl() to die()s,
akin to the other get_refs_*() functions.

Cc: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.6.5 v1.5.6.5
Junio C Hamano [Wed, 6 Aug 2008 19:04:06 +0000 (12:04 -0700)]
GIT 1.5.6.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFiles given on the command line are relative to $cwd
Junio C Hamano [Wed, 6 Aug 2008 18:43:47 +0000 (11:43 -0700)]
Files given on the command line are relative to $cwd

When running "git commit -F file" and "git tag -F file" from a
subdirectory, we should take it as relative to the directory we started
from, not relative to the top-level directory.

This adds a helper function "parse_options_fix_filename()" to make it more
convenient to fix this class of issues.  Ideally, parse_options() should
support a new type of option, "OPT_FILENAME", to do this uniformly, but
this patch is meant to go to 'maint' to fix it minimally.

One thing to note is that value for "commit template file" that comes from
the command line is taken as relative to $cwd just like other parameters,
but when it comes from the configuration varilable 'commit.template', it
is taken as relative to the working tree root as before.  I think this
difference actually is sensible (not that I particularly think
commit.template itself is sensible).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix diff-tree --stdin documentation
Junio C Hamano [Wed, 6 Aug 2008 05:32:28 +0000 (22:32 -0700)]
fix diff-tree --stdin documentation

Long time ago, the feature of "diff-tree --stdin" to take a commit and its
parents on one line was broken, and did not support the common:

    git rev-list --parents $commits... -- $paths... |
    git diff-tree --stdin -v -p

usage pattern by Porcelains properly.  For diff-tree to talk sensibly
about commits, it needs to see commits, not just trees; the code was fixed
to take list of commits on the standard input in 1.2.0.

However we left the documentation stale for a long time, until Karl
Hasselström finally noticed it very recently.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRelNotes 1.5.6.5 updates
Junio C Hamano [Wed, 6 Aug 2008 04:20:59 +0000 (21:20 -0700)]
RelNotes 1.5.6.5 updates

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff.renamelimit is a basic diff configuration
Linus Torvalds [Tue, 5 Aug 2008 18:27:30 +0000 (11:27 -0700)]
diff.renamelimit is a basic diff configuration

The configuration was added as a core option in 3299c6f (diff: make
default rename detection limit configurable., 2005-11-15), but 9ce392f
(Move diff.renamelimit out of default configuration., 2005-11-21)
separated diff-related stuff out of the core.

Up to that point it was Ok.

When we separated the Porcelain options out of the git_diff_config in
83ad63c (diff: do not use configuration magic at the core-level,
2006-07-08), we should have been more careful.

This mistake made diff-tree plumbing and git-show Porcelain to notice
different set of renames when the user explicitly asked for rename
detection.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
Jim Meyering [Tue, 5 Aug 2008 14:54:42 +0000 (16:54 +0200)]
git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: typos / spelling fixes in older RelNotes
Mike Ralphson [Tue, 5 Aug 2008 16:12:06 +0000 (17:12 +0100)]
Documentation: typos / spelling fixes in older RelNotes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-name-rev: don't use printf without format
René Scharfe [Sun, 3 Aug 2008 13:44:33 +0000 (15:44 +0200)]
git-name-rev: don't use printf without format

printf() without an explicit format string is not a good coding practise,
unless the printed string is guaranteed to not contain percent signs.  While
fixing this, we might as well combine the calls to fwrite() and printf().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-name-rev: allow --name-only in combination with --stdin
Pieter de Bie [Thu, 31 Jul 2008 13:20:34 +0000 (15:20 +0200)]
git-name-rev: allow --name-only in combination with --stdin

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-name-rev.c: split deeply nested part from the main function
Junio C Hamano [Sat, 2 Aug 2008 18:04:22 +0000 (11:04 -0700)]
builtin-name-rev.c: split deeply nested part from the main function

The main function of this command implementation tries to do too many
things.  Split out a handling of single input line into a separate
function to reduce nesting level and clutter.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStart 1.5.6.5 RelNotes to describe accumulated fixes
Junio C Hamano [Sat, 2 Aug 2008 06:54:01 +0000 (23:54 -0700)]
Start 1.5.6.5 RelNotes to describe accumulated fixes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake git-add -i accept ranges like 7-
Ciaran McCreesh [Mon, 14 Jul 2008 18:29:37 +0000 (19:29 +0100)]
Make git-add -i accept ranges like 7-

git-add -i ranges expect number-number. But for the supremely lazy, typing in
that second number when selecting "from patch 7 to the end" is wasted effort.
So treat an empty second number in a range as "until the last item".

Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate my e-mail address
Junio C Hamano [Mon, 21 Jul 2008 19:14:42 +0000 (12:14 -0700)]
Update my e-mail address

The old cox.net address is still getting mails from gitters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-diff(1): "--c" -> "--cc" typo fix
Jonathan Nieder [Mon, 21 Jul 2008 18:34:06 +0000 (13:34 -0500)]
git-diff(1): "--c" -> "--cc" typo fix

git diff does not take a --c option.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-submodule: move ill placed shift.
Pierre Habouzit [Mon, 21 Jul 2008 18:15:59 +0000 (20:15 +0200)]
git-submodule: move ill placed shift.

When running git submodule update -i, the "-i" is shifted before recursing
into cmd_init and then again outside of the loop. This causes some /bin/sh
to complain about shifting when there are no arguments left (and would
discard anything written after -i too).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot/t4202-log.sh: add newline at end of file
Brandon Casey [Tue, 22 Jul 2008 21:23:31 +0000 (16:23 -0500)]
t/t4202-log.sh: add newline at end of file

Some shells hang when parsing the script if the last statement is not
followed by a newline. So add one.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosort_in_topological_order(): avoid setting a commit flag
Johannes Schindelin [Wed, 23 Jul 2008 00:51:36 +0000 (01:51 +0100)]
sort_in_topological_order(): avoid setting a commit flag

We used to set the TOPOSORT flag of commits during the topological
sorting, but we can just as well use the member "indegree" for it:
indegree is now incremented by 1 in the cases where the commit used
to have the TOPOSORT flag.

This is the same behavior as before, since indegree could not be
non-zero when TOPOSORT was unset.

Incidentally, this fixes the bug in show-branch where the 8th column
was not shown: show-branch sorts the commits in topological order,
assuming that all the commit flags are available for show-branch's
private matters.

But this was not true: TOPOSORT was identical to the flag corresponding
to the 8th ref.  So the flags for the 8th column were unset by the
topological sorting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: clarify diff --cc
Junio C Hamano [Wed, 23 Jul 2008 23:16:05 +0000 (16:16 -0700)]
Documentation: clarify diff --cc

The definition of an "uninteresting" hunk was not in line with reality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoPropagate -u/--upload-pack option of "git clone" to transport.
Steve Haslam [Fri, 25 Jul 2008 17:51:51 +0000 (18:51 +0100)]
Propagate -u/--upload-pack option of "git clone" to transport.

The -u option to override the remote system's path to git-upload-pack was
being ignored by "git clone"; caused by a missing call to
transport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in
when git-clone was converted from shell to C.

Signed-off-by: Steve Haslam <shaslam@lastminute.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix diff.external example
Anders Melchiorsen [Sun, 27 Jul 2008 11:12:15 +0000 (13:12 +0200)]
Documentation: fix diff.external example

The diff.external examples pass a flag to gnu-diff, but GNU diff
does not follow the GIT_EXTERNAL_DIFF interface.

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake sure parsed wildcard refspec ends with slash
Junio C Hamano [Sun, 27 Jul 2008 06:15:51 +0000 (23:15 -0700)]
make sure parsed wildcard refspec ends with slash

A wildcard refspec is internally parsed into a refspec structure with src
and dst strings.  Many parts of the code assumed that these do not include
the trailing "/*" when matching the wildcard pattern with an actual ref we
see at the remote.  What this meant was that we needed to make sure not
just that the prefix matched, and also that a slash followed the part that
matched.

But a codepath that scans the result from ls-remote and finds matching
refs forgot to check the "matching part must be followed by a slash" rule.
This resulted in "refs/heads/b1" from the remote side to mistakenly match
the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.

Worse, the refspec crafted internally by "git-clone", and a hardcoded
preparsed refspec that is used to implement "git-fetch --tags", violated
this "parsed widcard refspec does not end with slash" rule; simply adding
the "matching part must be followed by a slash" rule then would have
broken codepaths that use these refspecs.

This commit changes the rule to require a trailing slash to parsed
wildcard refspecs.  IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
src = "refs/heads/b/" and dst = "refs/remotes/b/".  This allows us to
simplify the matching logic because we only need to do a prefixcmp() to
notice "refs/heads/b/one" matches and "refs/heads/b1" does not.

Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoinit: handle empty "template" parameter
Jeff King [Mon, 28 Jul 2008 06:02:04 +0000 (02:02 -0400)]
init: handle empty "template" parameter

If a user passes "--template=", then our template parameter
is blank. Unfortunately, copy_templates() assumes it has at
least one character, and does all sorts of bad things like
reading from template[-1] and then proceeding to link all of
'/' into the .git directory.

This patch just checks for that condition in copy_templates
and aborts. As a side effect, this means that --template=
now has the meaning "don't copy any templates."

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-revert.c: typofix
Stephan Beyer [Sat, 2 Aug 2008 01:51:21 +0000 (03:51 +0200)]
builtin-revert.c: typofix

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: fix shell quoting
Junio C Hamano [Fri, 25 Jul 2008 19:35:10 +0000 (12:35 -0700)]
Makefile: fix shell quoting

Makefile records paths to a few programs in GIT-BUILD-OPTIONS file.  These
paths need to be quoted twice: once to protect specials from the shell
that runs the generated GIT-BUILD-OPTIONS file, and again to protect them
(and the first level of quoting itself) from the shell that runs the
"echo" inside the Makefile.

You can test this by trying:

    $ ln -s /bin/tar "$HOME/Tes' program/tar"
    $ make TAR="$HOME/Tes' program/tar" test

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: propagate $(TAR) down from the toplevel Makefile
Junio C Hamano [Fri, 25 Jul 2008 18:09:48 +0000 (11:09 -0700)]
tests: propagate $(TAR) down from the toplevel Makefile

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoindex-pack.c: correctly initialize appended objects
Björn Steinbrink [Thu, 24 Jul 2008 17:32:00 +0000 (18:32 +0100)]
index-pack.c: correctly initialize appended objects

When index-pack completes a thin pack it appends objects to the pack.
Since the commit 92392b4(index-pack: Honor core.deltaBaseCacheLimit when
resolving deltas) such an object can be pruned in case of memory
pressure, and will be read back again by get_data_from_pack().  For this
to work, the fields in object_entry structure need to be initialized
properly.

Noticed by Pierre Habouzit.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosend-email: find body-encoding correctly
Peter Valdemar Mørch [Fri, 25 Jul 2008 13:06:48 +0000 (15:06 +0200)]
send-email: find body-encoding correctly

In 8291db6 (git-send-email: add charset header if we add encoded 'From',
2007-11-16), "$1" is used from a regexp without using () to capture
anything in $1. Later, when that value was used, it causes a warning about
a variable being undefined, instead of using the correct value for
comparison (not that it makes difference in the current code that does not
do actual re-encoding).

Signed-off-by: Peter Valdemar Mørch <peter@morch.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-checkout: fix command line parsing.
Pierre Habouzit [Wed, 23 Jul 2008 10:15:32 +0000 (12:15 +0200)]
git-checkout: fix command line parsing.

This fixes an issue when you use:

    $ git checkout -- <path1> [<paths>...]

and that <path1> can also be understood as a reference. git-checkout
mistakenly understands this as the same as:

    $ git checkout <path1> -- [<paths>...]

because parse-options was eating the '--' and the argument parser thought
he was parsing:

    $ git checkout <path1> [<paths>...]

Where there indeed is an ambiguity

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix usage string for git grep
Jonathan Nieder [Sun, 20 Jul 2008 19:13:08 +0000 (14:13 -0500)]
fix usage string for git grep

Without this patch, git-grep gives confusing usage information:

$ git grep --confused
usage: git grep <option>* <rev>* [-e] <pattern> [<path>...]
$ git grep HEAD pattern
fatal: ambiguous argument 'pattern': unknown revision or path no
t in the working tree.
Use '--' to separate paths from revisions

So put <pattern> before the <rev>s, in accordance with actual correct
usage.  While we're changing the usage string, we might as well include
the "--" separating revisions and paths, too.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorefresh-index: fix bitmask assignment
Junio C Hamano [Sun, 20 Jul 2008 06:25:00 +0000 (23:25 -0700)]
refresh-index: fix bitmask assignment

5fdeacb (Teach update-index about --ignore-submodules, 2008-05-14) added a
new refresh option flag but did not assign a unique bit for it correctly,
and broke "update-index --ignore-missing".

This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.6.4 v1.5.6.4
Junio C Hamano [Sat, 19 Jul 2008 17:58:01 +0000 (10:58 -0700)]
GIT 1.5.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-rm: fix index lock file path
Olivier Marin [Sat, 19 Jul 2008 16:24:46 +0000 (18:24 +0200)]
builtin-rm: fix index lock file path

When hold_locked_index() is called with a relative git_dir and you are
outside the work tree, the lock file become relative to the current
directory. So when later setup_work_tree() change the current directory
it breaks lock file path and commit_locked_index() fails.

This patch move index locking code after setup_work_tree() call to make
lock file relative to the working tree as it should be and add a test
case.

Noticed by Nick Andrew.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'sp/maint-index-pack' into maint
Junio C Hamano [Fri, 18 Jul 2008 22:39:51 +0000 (15:39 -0700)]
Merge branch 'sp/maint-index-pack' into maint

* sp/maint-index-pack:
  index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
  index-pack: Track the object_entry that creates each base_data
  index-pack: Chain the struct base_data on the stack for traversal
  index-pack: Refactor base arguments of resolve_delta into a struct

15 years agohttp-fetch: do not SEGV after fetching a bad pack idx file
Junio C Hamano [Fri, 18 Jul 2008 07:11:40 +0000 (00:11 -0700)]
http-fetch: do not SEGV after fetching a bad pack idx file

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorev-list: honor --quiet option
Junio C Hamano [Fri, 18 Jul 2008 05:39:09 +0000 (22:39 -0700)]
rev-list: honor --quiet option

Nick Andrew noticed that rev-list lets --quiet option to be parsed by
underlying diff_options parser but did not pick up the result.  This
resulted in --quiet option to become effectively a no-op.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapi-run-command.txt: typofix
Stephan Beyer [Thu, 17 Jul 2008 23:53:55 +0000 (01:53 +0200)]
api-run-command.txt: typofix

Replace "run_command_v_opt_dir" by "run_command_v_opt_cd".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStart preparing 1.5.6.4 release notes
Junio C Hamano [Wed, 16 Jul 2008 22:55:51 +0000 (15:55 -0700)]
Start preparing 1.5.6.4 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit fetch-pack: do not complain about "no common commits" in an empty repo
Johannes Schindelin [Wed, 2 Jul 2008 17:06:56 +0000 (18:06 +0100)]
git fetch-pack: do not complain about "no common commits" in an empty repo

If the repo is empty, it is obvious that there are no common commits
when fetching from _anywhere_.

So there is no use in saying it in that case, and it can even be
annoying.  Therefore suppress the message unilaterally if the repository
is empty prior to the fetch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/maint-pretty-mailmap' into maint
Junio C Hamano [Wed, 16 Jul 2008 22:27:03 +0000 (15:27 -0700)]
Merge branch 'js/maint-pretty-mailmap' into maint

* js/maint-pretty-mailmap:
  Add pretty format %aN which gives the author name, respecting .mailmap

15 years agoMerge branch 'sp/maint-bash-completion-optim' into maint
Junio C Hamano [Wed, 16 Jul 2008 22:25:24 +0000 (15:25 -0700)]
Merge branch 'sp/maint-bash-completion-optim' into maint

* sp/maint-bash-completion-optim:
  bash completion: Resolve git show ref:path<tab> losing ref: portion
  bash completion: Append space after file names have been completed
  bash completion: Don't offer "a.." as a completion for "a."
  bash completion: Improve responsiveness of git-log completion

15 years agoMerge branch 'sp/maint-pack-memuse' into maint
Junio C Hamano [Wed, 16 Jul 2008 22:24:07 +0000 (15:24 -0700)]
Merge branch 'sp/maint-pack-memuse' into maint

* sp/maint-pack-memuse:
  Correct pack memory leak causing git gc to try to exceed ulimit

15 years agoMerge branch 'ls/maint-mailinfo-patch-label' into maint
Junio C Hamano [Wed, 16 Jul 2008 22:23:19 +0000 (15:23 -0700)]
Merge branch 'ls/maint-mailinfo-patch-label' into maint

* ls/maint-mailinfo-patch-label:
  git-mailinfo: Fix getting the subject from the in-body [PATCH] line

15 years agoMerge branch 'js/maint-daemon-syslog' into maint
Junio C Hamano [Wed, 16 Jul 2008 22:22:05 +0000 (15:22 -0700)]
Merge branch 'js/maint-daemon-syslog' into maint

* js/maint-daemon-syslog:
  git daemon: avoid calling syslog() from a signal handler

15 years agorebase-i: keep old parents when preserving merges
Stephan Beyer [Wed, 16 Jul 2008 01:51:49 +0000 (03:51 +0200)]
rebase-i: keep old parents when preserving merges

When "rebase -i -p" tries to preserve merges of unrelated branches, it
lost some parents:

 - When you have more than two parents, the commit in the new history
   ends up with fewer than expected number of parents and this breakage
   goes unnoticed;

 - When you are rebasing a merge with two parents and one is lost, the
   command tries to cherry-pick the original merge commit, and the command
   fails.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot7600-merge: Use test_expect_failure to test option parsing
Johannes Sixt [Wed, 16 Jul 2008 08:33:52 +0000 (10:33 +0200)]
t7600-merge: Use test_expect_failure to test option parsing

It used plain 'if git merge ...', which hides a segfault. The test does not pass.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix buffer overflow in prepare_attr_stack
Dmitry Potapov [Wed, 16 Jul 2008 15:39:55 +0000 (19:39 +0400)]
Fix buffer overflow in prepare_attr_stack

If PATH_MAX on your system is smaller than a path stored in the git repo,
it may cause the buffer overflow in prepare_attr_stack.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix buffer overflow in git diff
Dmitry Potapov [Wed, 16 Jul 2008 14:54:02 +0000 (18:54 +0400)]
Fix buffer overflow in git diff

If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix buffer overflow in git-grep
Dmitry Potapov [Wed, 16 Jul 2008 15:33:29 +0000 (19:33 +0400)]
Fix buffer overflow in git-grep

If PATH_MAX on your system is smaller than any path stored in the git
repository, that can cause memory corruption inside of the grep_tree
function used by git-grep.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-cvsserver: fix call to nonexistant cleanupWorkDir()
Lars Noschinski [Wed, 16 Jul 2008 11:35:46 +0000 (13:35 +0200)]
git-cvsserver: fix call to nonexistant cleanupWorkDir()

git-cvsserver.perl contained a single call to a nonexistant function
cleanupWorkDir(). This was obviously a typo for cleanupWorkTree().

Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git-cherry-pick.txt et al.: Fix misleading -n description
Petr Baudis [Wed, 16 Jul 2008 12:35:22 +0000 (14:35 +0200)]
Documentation/git-cherry-pick.txt et al.: Fix misleading -n description

The manual page of git-cherry-pick and git-revert asserts that -n works
primarily on the working tree, while in fact the primary object it operates
on is the index, and the changes only "accidentally" propagate to the
working tree. This e.g. leads innocent #git IRC folks to believe that you
can use -n to prepare changes for git-add -i staging.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoindex-pack: Honor core.deltaBaseCacheLimit when resolving deltas
Shawn O. Pearce [Tue, 15 Jul 2008 04:45:34 +0000 (04:45 +0000)]
index-pack: Honor core.deltaBaseCacheLimit when resolving deltas

If we are trying to resolve deltas for a long delta chain composed
of multi-megabyte objects we can easily run into requiring 500M+
of memory to hold each object in the chain on the call stack while
we recurse into the dependent objects and resolve them.

We now use a simple delta cache that discards objects near the
bottom of the call stack first, as they are the most least recently
used objects in this current delta chain.  If we recurse out of a
chain we may find the base object is no longer available, as it was
free'd to keep memory under the deltaBaseCacheLimit.  In such cases
we must unpack the base object again, which will require recursing
back to the root of the top of the delta chain as we released that
root first.

The astute reader will probably realize that we can still exceed
the delta base cache limit, but this happens only if the most
recent base plus the delta plus the inflated dependent sum up to
more than the base cache limit.  Due to the way patch_delta is
currently implemented we cannot operate in less memory anyway.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoindex-pack: Track the object_entry that creates each base_data
Shawn O. Pearce [Mon, 14 Jul 2008 02:07:46 +0000 (22:07 -0400)]
index-pack: Track the object_entry that creates each base_data

If we free the data stored within a base_data we need the struct
object_entry to get the data back again for use with another dependent
delta.  Storing the object_entry* in base_data makes it simple to call
get_data_from_pack() to recover the compressed information.

This however means that we must add the missing base object to the end of
our packfile prior to calling resolve_delta() on each of the dependent
deltas.  Adding the base first ensures we can read the base back from the
pack we are indexing, as if it had been included by the remote side.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoindex-pack: Chain the struct base_data on the stack for traversal
Shawn O. Pearce [Mon, 14 Jul 2008 02:07:45 +0000 (22:07 -0400)]
index-pack: Chain the struct base_data on the stack for traversal

We need to release earlier inflated base objects when memory gets
low, which means we need to be able to walk up or down the stack
to locate the objects we want to release, and free their data.

The new link/unlink routines allow inserting and removing the struct
base_data during recursion inside resolve_delta, and the global
base_cache gives us the head of the chain (bottom of the stack)
so we can traverse it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoindex-pack: Refactor base arguments of resolve_delta into a struct
Shawn O. Pearce [Mon, 14 Jul 2008 02:07:44 +0000 (22:07 -0400)]
index-pack: Refactor base arguments of resolve_delta into a struct

We need to discard base objects which are not recently used if our
memory gets low, such as when we are unpacking a long delta chain
of a very large object.

To support tracking the available base objects we combine the
pointer and size into a struct.  Future changes would allow the
data pointer to be free'd and marked NULL if memory gets low.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Resolve git show ref:path<tab> losing ref: portion
Shawn O. Pearce [Tue, 15 Jul 2008 05:52:04 +0000 (05:52 +0000)]
bash completion: Resolve git show ref:path<tab> losing ref: portion

Linus reported that the bash completion for git show often dropped
the ref portion of the argument (stuff before the :) when trying
to complete a file name of a file in another branch or tag.

Björn Steinbrink tracked it down to the gvfs completion script
which comes standard on many Fedora Core based systems.  That is
removing : from COMP_WORDBREAKS, making readline treat the entire
argument (including the ref) as the name that must be completed.
When the git completion routines supplied a completion of just the
filename, readline replaced everything.

Since Git users often need to use "ref:path" or "ref:ref" sort of
arguments, and expect completion support on both sides of the :
we really want the : in COMP_WORDBREAKS to provide a good user
experience.  This is also the default that ships with bash as it
can be useful in other contexts, such as rcp/scp.

We now try to add : back to COMP_WORDBREAKS if it has been removed
by a script that loaded before us.  However if this doesn't work
(as the : is stripped after we load) we fallback in the completion
routines to include "ref:" as part of the prefix for completions,
allowing readine to fully insert the argument the user wanted.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Append space after file names have been completed
Shawn O. Pearce [Mon, 14 Jul 2008 00:22:03 +0000 (00:22 +0000)]
bash completion: Append space after file names have been completed

When completing `git show origin/maint:Makef<tab>` we should add a
space after the filename has been completed, so that the user can
immediately begin the next argument.

I also added a special case for the symlink variant so we treat it
just like a normal blob, as there are no items below it in the Git
tree structure.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-mailinfo: Fix getting the subject from the in-body [PATCH] line
Lukas Sandström [Thu, 10 Jul 2008 21:41:33 +0000 (23:41 +0200)]
git-mailinfo: Fix getting the subject from the in-body [PATCH] line

"Subject: " isn't in the static array "header", and thus
memcmp("Subject:", header[i], 7) will never match.

Even if it did so, hdr_data[] may not have been allocated if there weren't
a "Subject: " in-body when we process "[PATCH]" in the affected codepath.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Don't offer "a.." as a completion for "a."
Shawn O. Pearce [Sun, 13 Jul 2008 22:06:31 +0000 (22:06 +0000)]
bash completion: Don't offer "a.." as a completion for "a."

If the user is trying to complete "v1.5.3.<tab>" to see all of
the available maintenance releases for 1.5.3 we should not give
them an extra dot as the completion.  Instead if the user wants
a ".." or a "..." operator they should key the two dots out on
their own.  Its the same number of keystrokes either way.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.6.3 v1.5.6.3
Junio C Hamano [Sun, 13 Jul 2008 22:23:43 +0000 (15:23 -0700)]
GIT 1.5.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix quadratic performance in rewrite_one.
Alexander N. Gavrilov [Sat, 12 Jul 2008 18:00:57 +0000 (22:00 +0400)]
Fix quadratic performance in rewrite_one.

Parent commits are usually older than their children. Thus,
on each iteration of the loop in rewrite_one, add_parents_to_list
traverses all commits previously processed by the loop.
It performs very poorly in case of very long rewrite chains.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-am: Do not exit silently if committer is unset
Stephan Beyer [Sat, 12 Jul 2008 15:46:59 +0000 (17:46 +0200)]
git-am: Do not exit silently if committer is unset

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Improve responsiveness of git-log completion
Shawn O. Pearce [Sun, 13 Jul 2008 02:37:42 +0000 (02:37 +0000)]
bash completion: Improve responsiveness of git-log completion

Junio noticed the bash completion has been taking a long time lately.
Petr Baudis tracked it down to 72e5e989b ("bash: Add space after
unique command name is completed.").  Tracing the code showed
we spent significant time inside of this loop within __gitcomp,
due to the string copying overhead.

  [28.146109654] _git common over
  [28.164791148] gitrefs in
  [28.280302268] gitrefs dir out
  [28.300939737] gitcomp in
  [28.308378112] gitcomp pre-case
* [28.313407453] gitcomp iter in
* [28.701270296] gitcomp iter out
  [28.713370786] out normal

Since __git_refs avoids this string copying by forking and using
echo we use the same trick here when we need to finish generating
the names for the caller.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot0004: fix timing bug
Junio C Hamano [Sat, 12 Jul 2008 11:15:56 +0000 (04:15 -0700)]
t0004: fix timing bug

The test created an initial commit, made .git/objects unwritable and then
exercised various codepaths to create loose commit, tree and blob objects
to make sure the commands notice failures from these attempts.

However, the initial commit was not preceded with test_tick, which made
its object name depend on the timestamp.  The names of all the later tree
and blob objects the test tried to create were static.  If the initial
commit's object name happened to begin with the same two hexdigits as the
tree or blob objects the test later attempted to create, the fan-out
directory in which these tree or blob would be created is already created
when the initial commit was made, and the object creation succeeds, and
commands being tested should not notice any failure --- in short, the test
was bogus.

This makes the fan-out directories also unwritable, and adds test_tick
before the commit object creation to make the test repeatable.

The contents of the file to create a blob from "a" to "60" is to force the
name of the blob object to begin with "1b", which shares the fan-out
directory with the initial commit that is created with the test.  This was
useful when diagnosing the breakage of this test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd pretty format %aN which gives the author name, respecting .mailmap
Johannes Schindelin [Fri, 11 Jul 2008 23:28:18 +0000 (00:28 +0100)]
Add pretty format %aN which gives the author name, respecting .mailmap

The pretty format %an does not respect .mailmap, but gives the exact
author name recorded in the commit.  Sometimes it is more desirable,
however, to look if the email has another name mapped to it in .mailmap.

This commit adds %aN (and %cN for the committer name) to do exactly that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-mailinfo: document the -n option
Lukas Sandström [Thu, 10 Jul 2008 21:36:28 +0000 (23:36 +0200)]
git-mailinfo: document the -n option

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix backwards-incompatible handling of core.sharedRepository
Petr Baudis [Sat, 12 Jul 2008 01:15:03 +0000 (03:15 +0200)]
Fix backwards-incompatible handling of core.sharedRepository

06cbe85 (Make core.sharedRepository more generic, 2008-04-16) broke the
traditional setting of core.sharedRepository to true, which was to make
the repository group writable: with umask 022, it would clear the
permission bits for 'other'. (umask 002 did not exhibit this behaviour
since pre-chmod() check in adjust_shared_perm() fails in that case.)

The call to adjust_shared_perm() should only loosen the permission.
If the user has umask like 022 or 002 that allow others to read, the
resulting files should be made readable and writable by group, without
restricting the readability by others.

This patch fixes the adjust_shared_perm() mode tweak based on Junio's
suggestion and adds the appropriate tests to t/t1301-shared-repo.sh.

Cc: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCorrect pack memory leak causing git gc to try to exceed ulimit
Shawn O. Pearce [Wed, 9 Jul 2008 07:10:07 +0000 (07:10 +0000)]
Correct pack memory leak causing git gc to try to exceed ulimit

When recursing to unpack a delta base we must unuse_pack() so that
the pack window for the current object does not remain pinned in
memory while the delta base is itself being unpacked and materialized
for our use.

On a long delta chain of 50 objects we may need to access 6 different
windows from a very large (>3G) pack file in order to obtain all
of the delta base content.  If the process ulimit permits us to
map/allocate only 1.5G we must release windows during this recursion
to ensure we stay within the ulimit and transition memory from pack
cache to standard malloc, or other mmap needs.

Inserting an unuse_pack() call prior to the recursion allows us to
avoid pinning the current window, making it available for garbage
collection if memory runs low.

This has been broken since at least before 1.5.1-rc1, and very
likely earlier than that.  Its fixed now.  :)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStart preparing release notes for 1.5.6.3
Junio C Hamano [Wed, 9 Jul 2008 06:57:14 +0000 (23:57 -0700)]
Start preparing release notes for 1.5.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-submodule - Fix bugs in adding an existing repo as a module
Mark Levedahl [Tue, 8 Jul 2008 02:36:40 +0000 (22:36 -0400)]
git-submodule - Fix bugs in adding an existing repo as a module

git-submodule add would trip if path to the submodule included a space,
or if its .git was a gitdir: link to a GIT_DIR kept elsewhere. Fix both.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: offer only paths after '--'
SZEDER Gábor [Tue, 8 Jul 2008 16:56:14 +0000 (18:56 +0200)]
bash: offer only paths after '--'

Many git commands use '--' to separate subcommands, options, and refs
from paths.  However, the programmable completion for several of these
commands does not respect the '--', and offer subcommands, options, or
refs after a '--', although only paths are permitted.  e.g. 'git bisect
-- <TAB>' offers subcommands, 'git log -- --<TAB>' offers options and
'git log -- git<TAB>' offers all gitgui tags.

The completion for the following commands share this wrong behaviour:
  am add bisect commit diff log reset shortlog submodule gitk.

To avoid this, we check the presence of a '--' on the command line first
and let the shell do filename completion, if one is found.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove unnecessary pack-*.keep file after successful git-clone
Shawn O. Pearce [Tue, 8 Jul 2008 04:46:06 +0000 (04:46 +0000)]
Remove unnecessary pack-*.keep file after successful git-clone

Once a clone is successful we no longer need to hold onto the
.keep file created by the transport.  Delete the file so we
can later repack the complete repository.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake deleting a missing ref more quiet
Jeff King [Tue, 8 Jul 2008 04:08:02 +0000 (00:08 -0400)]
make deleting a missing ref more quiet

If git attempts to delete a ref, but the unlink of the ref
file fails, we print a message to stderr. This is usually a
good thing, but if the error is ENOENT, then it indicates
that the ref has _already_ been deleted. And since that's
our goal, it doesn't make sense to complain to the user.

This harmonizes the error reporting behavior for the
unpacked and packed cases; the packed case already printed
nothing on ENOENT, but the unpacked printed unconditionally.

Additionally, send-pack would, when deleting the tracking
ref corresponding to a remote delete, print "Failed to
delete" on any failure. This can be a misleading
message, since we actually _did_ delete at the remote side,
but we failed to delete locally. Rather than make the
message more precise, let's just eliminate it entirely; the
delete_ref routine already takes care of printing out a much
more specific message about what went wrong.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'qq/maint' into maint
Junio C Hamano [Tue, 8 Jul 2008 20:05:06 +0000 (13:05 -0700)]
Merge branch 'qq/maint' into maint

* qq/maint:
  run_command(): respect GIT_TRACE

15 years agoMerge branch 'lt/racy-empty' into maint
Junio C Hamano [Tue, 8 Jul 2008 07:19:17 +0000 (00:19 -0700)]
Merge branch 'lt/racy-empty' into maint

* lt/racy-empty:
  racy-git: an empty blob has a fixed object name

15 years agoMerge branch 'qq/maint' (early part) into maint
Junio C Hamano [Mon, 7 Jul 2008 23:09:17 +0000 (16:09 -0700)]
Merge branch 'qq/maint' (early part) into maint

* 'qq/maint' (early part):
  git-svn.perl: workaround assertions in svn library 1.5.0
  mailinfo: feed the correct line length to decode_transfer_encoding()
  git-clone: remove leftover debugging fprintf().
  Fix "config_error_nonbool" used with value instead of key
  clone -q: honor "quiet" option over native transports.
  attribute documentation: keep EXAMPLE at end
  builtin-commit.c: Use 'git_config_string' to get 'commit.template'
  http.c: Use 'git_config_string' to clean up SSL config.
  diff.c: Use 'git_config_string' to get 'diff.external'
  convert.c: Use 'git_config_string' to get 'smudge' and 'clean'
  builtin-log.c: Use 'git_config_string' to get 'format.subjectprefix' and 'format.suffix'
  Documentation cvs: Clarify when a bare repository is needed
  Documentation: be precise about which date --pretty uses

15 years agorun_command(): respect GIT_TRACE
Johannes Schindelin [Mon, 7 Jul 2008 13:41:34 +0000 (14:41 +0100)]
run_command(): respect GIT_TRACE

When GIT_TRACE is set, the user is most likely wanting to see an external
command that is about to be executed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn.perl: workaround assertions in svn library 1.5.0
Gerrit Pape [Sun, 6 Jul 2008 19:28:50 +0000 (19:28 +0000)]
git-svn.perl: workaround assertions in svn library 1.5.0

With subversion 1.5.0 (C and perl libraries) the git-svn selftest
t9101-git-svn-props.sh fails at test 25 and 26.  The following commands
cause assertions in the svn library

 $ cd deeply
 $ git-svn propget svn:ignore .
 perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_ra/ra_loader.c:674: svn_ra_get_dir: Assertion `*path != '/'' failed.
 Aborted

 $ git-svn propget svn:ignore ..
 perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_subr/path.c:120: svn_path_join: Assertion `is_canonical(component, clen)' failed.

With this commit, git-svn makes sure the path doesn't start with a
slash, and is not a dot, working around these assertions.

The breakage was reported by Lucas Nussbaum through
 http://bugs.debian.org/489108

Signed-off-by: Gerrit Pape <pape@smarden.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomailinfo: feed the correct line length to decode_transfer_encoding()
Junio C Hamano [Mon, 7 Jul 2008 05:26:45 +0000 (22:26 -0700)]
mailinfo: feed the correct line length to decode_transfer_encoding()

When handling a MIME multipart message, multi-part boundary lines are eaten
by a call to handle_boundary() function from the main loop of handle_body(),
and after that happens, we should update the line length correctly, because
handle_boundary() udpates line[] with new data.

This was caused by a thinko in 9aa2309 (mailinfo: apply the same fix not
to lose NULs in BASE64 and QP codepaths, 2008-05-25).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-clone: remove leftover debugging fprintf().
Alex Riesen [Sun, 6 Jul 2008 22:56:49 +0000 (00:56 +0200)]
git-clone: remove leftover debugging fprintf().

Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix grammar in git-rev-parse(1).
Mikael Magnusson [Sun, 6 Jul 2008 20:34:21 +0000 (22:34 +0200)]
Fix grammar in git-rev-parse(1).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit daemon: avoid calling syslog() from a signal handler
Johannes Schindelin [Thu, 3 Jul 2008 15:27:24 +0000 (16:27 +0100)]
git daemon: avoid calling syslog() from a signal handler

Signal handlers should never call syslog(), as that can raise signals
of its own.

Instead, call the syslog() from the master process.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix "config_error_nonbool" used with value instead of key
Christian Couder [Sun, 6 Jul 2008 04:10:04 +0000 (06:10 +0200)]
Fix "config_error_nonbool" used with value instead of key

The function "config_error_nonbool", that is defined in "config.c",
is used to report an error when a config key in the config file
should have a corresponding value but it hasn't.

So the parameter to this function should be the key and not the
value, because the value is undefined. And it could crash if the
value is used.

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