git
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sun, 5 Apr 2009 08:04:38 +0000 (01:04 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  commit: abort commit if interactive add failed
  git-repack: use non-dashed update-server-info

Conflicts:
builtin-commit.c

15 years agocommit: abort commit if interactive add failed
Jeff King [Fri, 3 Apr 2009 19:28:56 +0000 (15:28 -0400)] 
commit: abort commit if interactive add failed

Previously we ignored the result of calling add_interactive,
which meant that if an error occurred we simply committed
whatever happened to be in the index.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-repack: use non-dashed update-server-info
Dan McGee [Sat, 4 Apr 2009 16:59:55 +0000 (11:59 -0500)] 
git-repack: use non-dashed update-server-info

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Thu, 2 Apr 2009 05:35:57 +0000 (22:35 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  Documentation: Remove an odd "instead"

15 years agoDocumentation: Remove an odd "instead"
Holger Weiß [Tue, 31 Mar 2009 16:57:01 +0000 (18:57 +0200)] 
Documentation: Remove an odd "instead"

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Mon, 30 Mar 2009 20:23:53 +0000 (13:23 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  Fix bash completion in path with spaces
  bash completion: only show 'log --merge' if merging
  git-tag(1): add hint about commit messages
  Documentation: update graph api example.

15 years agoFix bash completion in path with spaces
Daniel Cheng (aka SDiZ) [Mon, 30 Mar 2009 11:27:37 +0000 (19:27 +0800)] 
Fix bash completion in path with spaces

Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: only show 'log --merge' if merging
Thomas Rast [Mon, 16 Feb 2009 16:34:57 +0000 (17:34 +0100)] 
bash completion: only show 'log --merge' if merging

The gitk completion only shows --merge if MERGE_HEAD is present.
Do it the same way for git-log completion.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-tag(1): add hint about commit messages
Nico -telmich- Schottelius [Mon, 30 Mar 2009 11:58:21 +0000 (13:58 +0200)] 
git-tag(1): add hint about commit messages

If a tag is not annotated, git tag displays the commit message
instead. Add this hint to the manpage to unhide this secret.

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: update graph api example.
Allan Caffee [Mon, 30 Mar 2009 14:13:45 +0000 (10:13 -0400)] 
Documentation: update graph api example.

As of commit 03300c0 the graph API uses '*' for all nodes including merges.
This updates the example in the documentation to match.

Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Mon, 30 Mar 2009 06:11:03 +0000 (23:11 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  import-zips: fix thinko

15 years agoimport-zips: fix thinko
Johannes Schindelin [Sun, 29 Mar 2009 20:42:27 +0000 (22:42 +0200)] 
import-zips: fix thinko

Embarrassingly, the common prefix calculation did not work properly, due
to a mistake in the assignment: instead of assigning the dirname of the
current file name, the dirname of the current common prefix needs to
be assigned to common prefix, when the current prefix does not match the
current file name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotest-lib: Clean up comments and Makefile.
Emil Sit [Sat, 28 Mar 2009 01:57:18 +0000 (21:57 -0400)] 
test-lib: Clean up comments and Makefile.

Bring documentation in test-lib and clean target
in Makefile in-line with abc5d372.

Signed-off-by: Emil Sit <sit@emilsit.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --no-index: Do not generate patch output if other output is requested
Johannes Sixt [Wed, 25 Mar 2009 17:19:46 +0000 (18:19 +0100)] 
diff --no-index: Do not generate patch output if other output is requested

Previously, 'git diff --no-index --stat a b' generated patch output in
addition to the --stat output (or whatever other output format was
requested). Now only the requested output is generated, and patch
output remains the default.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Tue, 24 Mar 2009 22:31:15 +0000 (15:31 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  close_sha1_file(): make it easier to diagnose errors
  avoid possible overflow in delta size filtering computation

15 years agoclose_sha1_file(): make it easier to diagnose errors
Linus Torvalds [Tue, 24 Mar 2009 19:31:36 +0000 (12:31 -0700)] 
close_sha1_file(): make it easier to diagnose errors

A bug report with "unable to write sha1 file" made us realize that we do
not have enough information to guess why close() is failing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoavoid possible overflow in delta size filtering computation
Nicolas Pitre [Tue, 24 Mar 2009 19:56:12 +0000 (15:56 -0400)] 
avoid possible overflow in delta size filtering computation

On a 32-bit system, the maximum possible size for an object is less than
4GB, while 64-bit systems may cope with larger objects.  Due to this
limitation, variables holding object sizes are using an unsigned long
type (32 bits on 32-bit systems, or 64 bits on 64-bit systems).

When large objects are encountered, and/or people play with large delta
depth values, it is possible for the maximum allowed delta size
computation to overflow, especially on a 32-bit system.  When this
occurs, surviving result bits may represent a value much smaller than
what it is supposed to be, or even zero.  This prevents some objects
from being deltified although they do get deltified when a smaller depth
limit is used.  Fix this by always performing a 64-bit multiplication.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sun, 22 Mar 2009 22:40:55 +0000 (15:40 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  everyday: use the dashless form of git-init

15 years agoeveryday: use the dashless form of git-init
David Aguilar [Sun, 22 Mar 2009 09:15:13 +0000 (02:15 -0700)] 
everyday: use the dashless form of git-init

The 'Everyday GIT' guide was using the old dashed form
of git-init.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/maint-1.6.0-path-normalize' into maint-1.6.1
Junio C Hamano [Sun, 22 Mar 2009 05:59:19 +0000 (22:59 -0700)] 
Merge branch 'js/maint-1.6.0-path-normalize' into maint-1.6.1

* js/maint-1.6.0-path-normalize:
  Remove unused normalize_absolute_path()
  Test and fix normalize_path_copy()
  Fix GIT_CEILING_DIRECTORIES on Windows
  Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()
  Make test-path-utils more robust against incorrect use

15 years agoMerge branch 'jc/maint-1.6.0-pack-directory' into maint-1.6.1
Junio C Hamano [Sun, 22 Mar 2009 05:53:36 +0000 (22:53 -0700)] 
Merge branch 'jc/maint-1.6.0-pack-directory' into maint-1.6.1

* jc/maint-1.6.0-pack-directory:
  Fix odb_mkstemp() on AIX
  Make sure objects/pack exists before creating a new pack

Conflicts:
wrapper.c

15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 06:36:57 +0000 (23:36 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  bisect: fix another instance of eval'ed string
  bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped
  Support "\" in non-wildcard exclusion entries

Conflicts:
git-bisect.sh

15 years agoMerge branch 'en/maint-1.6.1-hash-object' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 06:11:23 +0000 (23:11 -0700)] 
Merge branch 'en/maint-1.6.1-hash-object' into maint-1.6.1

* en/maint-1.6.1-hash-object:
  Ensure proper setup of git_dir for git-hash-object

15 years agoMerge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.0
Junio C Hamano [Fri, 13 Mar 2009 04:48:43 +0000 (21:48 -0700)] 
Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.0

* ks/maint-1.6.0-mailinfo-folded:
  mailinfo: tests for RFC2047 examples
  mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'
  mailinfo: 'From:' header should be unfold as well
  mailinfo: correctly handle multiline 'Subject:' header

15 years agoMerge branch 'cc/maint-1.6.0-bisect-fix' into maint-1.6.0
Junio C Hamano [Fri, 13 Mar 2009 04:48:26 +0000 (21:48 -0700)] 
Merge branch 'cc/maint-1.6.0-bisect-fix' into maint-1.6.0

* cc/maint-1.6.0-bisect-fix:
  bisect: fix another instance of eval'ed string
  bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped

15 years agoMerge branch 'fg/maint-1.6.0-exclude-bq' into maint-1.6.0
Junio C Hamano [Fri, 13 Mar 2009 04:48:07 +0000 (21:48 -0700)] 
Merge branch 'fg/maint-1.6.0-exclude-bq' into maint-1.6.0

* fg/maint-1.6.0-exclude-bq:
  Support "\" in non-wildcard exclusion entries

15 years agoMerge branch 'js/maint-1.6.1-filter-branch-submodule' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:46:50 +0000 (21:46 -0700)] 
Merge branch 'js/maint-1.6.1-filter-branch-submodule' into maint-1.6.1

* js/maint-1.6.1-filter-branch-submodule:
  filter-branch: do not consider diverging submodules a 'dirty worktree'

15 years agoMerge branch 'gt/maint-1.6.1-utf8-width' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:46:35 +0000 (21:46 -0700)] 
Merge branch 'gt/maint-1.6.1-utf8-width' into maint-1.6.1

* gt/maint-1.6.1-utf8-width:
  builtin-blame.c: Use utf8_strwidth for author's names
  utf8: add utf8_strwidth()

15 years agoMerge branch 'js/maint-1.6.1-remote-remove-mirror' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:45:56 +0000 (21:45 -0700)] 
Merge branch 'js/maint-1.6.1-remote-remove-mirror' into maint-1.6.1

* js/maint-1.6.1-remote-remove-mirror:
  builtin-remote: make rm operation safer in mirrored repository
  builtin-remote: make rm() use properly named variable to hold return value

15 years agoMerge branch 'ek/maint-1.6.1-filter-branch-bare' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:45:21 +0000 (21:45 -0700)] 
Merge branch 'ek/maint-1.6.1-filter-branch-bare' into maint-1.6.1

* ek/maint-1.6.1-filter-branch-bare:
  filter-branch: Fix fatal error on bare repositories

15 years agoMerge branch 'jc/maint-1.6.1-add-u-remove-conflicted' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:45:14 +0000 (21:45 -0700)] 
Merge branch 'jc/maint-1.6.1-add-u-remove-conflicted' into maint-1.6.1

* jc/maint-1.6.1-add-u-remove-conflicted:
  add -u: do not fail to resolve a path as deleted

15 years agoMerge branch 'js/maint-1.6.1-rebase-i-submodule' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:45:02 +0000 (21:45 -0700)] 
Merge branch 'js/maint-1.6.1-rebase-i-submodule' into maint-1.6.1

* js/maint-1.6.1-rebase-i-submodule:
  Fix submodule squashing into unrelated commit
  rebase -i squashes submodule changes into unrelated commit

15 years agoMerge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:44:48 +0000 (21:44 -0700)] 
Merge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1

* jc/maint-1.6.1-allow-uninteresting-missing:
  revision traversal: allow UNINTERESTING objects to be missing

15 years agoMerge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:44:00 +0000 (21:44 -0700)] 
Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.1

* ks/maint-1.6.0-mailinfo-folded:
  mailinfo: tests for RFC2047 examples
  mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'
  mailinfo: 'From:' header should be unfold as well
  mailinfo: correctly handle multiline 'Subject:' header

15 years agoMerge branch 'jk/maint-1.6.1-cleanup-after-exec-failure' into maint-1.6.1
Junio C Hamano [Fri, 13 Mar 2009 04:43:38 +0000 (21:43 -0700)] 
Merge branch 'jk/maint-1.6.1-cleanup-after-exec-failure' into maint-1.6.1

* jk/maint-1.6.1-cleanup-after-exec-failure:
  git: use run_command() to execute dashed externals
  run_command(): help callers distinguish errors
  run_command(): handle missing command errors more gracefully
  git: s/run_command/run_builtin/

15 years agoMerge branch 'jc/maint-1.6.0-split-diff-metainfo' into maint-1.6.0
Junio C Hamano [Fri, 13 Mar 2009 03:01:28 +0000 (20:01 -0700)] 
Merge branch 'jc/maint-1.6.0-split-diff-metainfo' into maint-1.6.0

* jc/maint-1.6.0-split-diff-metainfo:
  diff.c: output correct index lines for a split diff

15 years agobuiltin-revert.c: release index lock when cherry-picking an empty commit
Chris Johnsen [Sat, 7 Mar 2009 09:30:51 +0000 (03:30 -0600)] 
builtin-revert.c: release index lock when cherry-picking an empty commit

When a cherry-pick of an empty commit is done, release the lock
held on the index.

The fix is the same as was applied to similar code in 4271666046.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: minor grammatical fixes.
David J. Mellor [Sat, 28 Feb 2009 21:12:59 +0000 (13:12 -0800)] 
Documentation: minor grammatical fixes.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoEnsure proper setup of git_dir for git-hash-object
Elijah Newren [Sat, 28 Feb 2009 19:56:49 +0000 (12:56 -0700)] 
Ensure proper setup of git_dir for git-hash-object

Call setup_git_directory() before git_config() to make sure git_dir is set
to the proper value.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Sat, 28 Feb 2009 22:05:09 +0000 (14:05 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  added missing backtick in git-apply.txt

15 years agoadded missing backtick in git-apply.txt
Danijel Tasov [Sat, 28 Feb 2009 20:03:54 +0000 (21:03 +0100)] 
added missing backtick in git-apply.txt

Signed-off-by: Danijel Tasov <dt@korn.shell.la>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobisect: fix another instance of eval'ed string
Christian Couder [Fri, 27 Feb 2009 06:31:22 +0000 (07:31 +0100)] 
bisect: fix another instance of eval'ed string

When there is nothing to be skipped, the output from
rev-list --bisect-vars was eval'ed without first being
strung together with &&; this is probably not a problem
as it is much less likely to be a bad input than the list
handcrafted by the filter_skip function, but it still is
a good discipline.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobisect: fix quoting TRIED revs when "bad" commit is also "skip"ped
Christian Couder [Fri, 27 Feb 2009 06:31:22 +0000 (07:31 +0100)] 
bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped

When the "bad" commit was also "skip"ped and when more than one
commit was skipped, the "filter_skipped" function would have
printed something like:

    bisect_rev=<hash1>|<hash2>

(where <hash1> and <hash2> are hexadecimal sha1 hashes)

and this would have been evaled later as piping "bisect_rev=<hash1>"
into "<hash2>", which would have failed.

So this patch makes the "filter_skipped" function properly quote
what it outputs, so that it will print something like:

bisect_rev='<hash1>|<hash2>'

which will be properly evaled later.  The caller was not stopping
properly because the scriptlet this function returned to be evaled
was not strung together with && and because of this, an error in
an earlier part of the output was simply ignored.

A test case is added to the test suite.

And while at it, we also initialize the VARS, FOUND and TRIED
variables, so that we protect ourselves from environment variables
the user may have with these names.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix odb_mkstemp() on AIX
Mike Ralphson [Thu, 26 Feb 2009 15:31:52 +0000 (16:31 +0100)] 
Fix odb_mkstemp() on AIX

The AIX mkstemp() modifies its template parameter to an empty string if
the call fails.  The existing code had already recomputed the template,
but too late to be good.

See also 6ff6af62, which fixed this problem in a different spot.

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake sure objects/pack exists before creating a new pack
Junio C Hamano [Wed, 25 Feb 2009 07:11:29 +0000 (23:11 -0800)] 
Make sure objects/pack exists before creating a new pack

In a repository created with git older than f49fb35 (git-init-db: create
"pack" subdirectory under objects, 2005-06-27), objects/pack/ directory is
not created upon initialization.  It was Ok because subdirectories are
created as needed inside directories init-db creates, and back then,
packfiles were recent invention.

After the said commit, new codepaths started relying on the presense of
objects/pack/ directory in the repository.  This was exacerbated with
8b4eb6b (Do not perform cross-directory renames when creating packs,
2008-09-22) that moved the location temporary pack files are created from
objects/ directory to objects/pack/ directory, because moving temporary to
the final location was done carefully with lazy leading directory creation.

Many packfile related operations in such an old repository can fail
mysteriously because of this.

This commit introduces two helper functions to make things work better.

 - odb_mkstemp() is a specialized version of mkstemp() to refactor the
   code and teach it to create leading directories as needed;

 - odb_pack_keep() refactors the code to create a ".keep" file while
   create leading directories as needed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMore friendly message when locking the index fails.
Matthieu Moy [Thu, 19 Feb 2009 12:54:18 +0000 (13:54 +0100)] 
More friendly message when locking the index fails.

Just saying that index.lock exists doesn't tell the user _what_ to do
to fix the problem. We should give an indication that it's normally
safe to delete index.lock after making sure git isn't running here.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocument git blame --reverse.
Matthieu Moy [Thu, 19 Feb 2009 12:34:48 +0000 (13:34 +0100)] 
Document git blame --reverse.

This was introduced in 85af7929ee125385c2771fa4eaccfa2f29dc63c9 but
not documented outside the commit message.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Note file formats send-email accepts
Todd Zullinger [Thu, 19 Feb 2009 03:51:06 +0000 (22:51 -0500)] 
Documentation: Note file formats send-email accepts

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: fix "export var=val"
Junio C Hamano [Wed, 18 Feb 2009 19:17:27 +0000 (11:17 -0800)] 
tests: fix "export var=val"

Some shells do not like "export var=val"; the right way to write
it is to do an assignment and then export just the variable name.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSkip timestamp differences for diff --no-index
Michael Spang [Wed, 18 Feb 2009 06:48:06 +0000 (01:48 -0500)] 
Skip timestamp differences for diff --no-index

We display empty diffs for files whose timestamps have changed.
Usually, refreshing the index makes those empty diffs go away.
However, when not using the index they are not very useful and
there is no option to suppress them.

This forces on the skip_stat_unmatch option for diff --no-index,
suppressing any empty diffs. This option is also used for diffs
against the index when "diff.autorefreshindex" is set, but that
option does not apply to diff --no-index.

Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git-push: --all, --mirror, --tags can not be combined
Gerrit Pape [Tue, 17 Feb 2009 09:25:02 +0000 (09:25 +0000)] 
Documentation/git-push: --all, --mirror, --tags can not be combined

While b259f09 made git-push output a better error message for 'git-push
--all --tags', this commit fixes the synopsis in the documentation.

Inconsistency spotted and fix suggested by Jari Aalto through
 http://bugs.debian.org/502567

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSupport "\" in non-wildcard exclusion entries
Finn Arne Gangstad [Tue, 10 Feb 2009 14:20:17 +0000 (15:20 +0100)] 
Support "\" in non-wildcard exclusion entries

"\" was treated differently in exclude rules depending on whether a
wildcard match was done. For wildcard rules, "\" was de-escaped in
fnmatch, but this was not done for other rules since they used strcmp
instead.  A file named "#foo" would not be excluded by "\#foo", but would
be excluded by "\#foo*".

We now treat all rules with "\" as wildcard rules.

Another solution could be to de-escape all non-wildcard rules as we
read them, but we would have to do the de-escaping exactly as fnmatch
does it to avoid inconsistencies.

Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoPrepare for 1.6.1.4.
Junio C Hamano [Thu, 12 Feb 2009 02:44:03 +0000 (18:44 -0800)] 
Prepare for 1.6.1.4.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Thu, 12 Feb 2009 02:32:37 +0000 (18:32 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  Make repack less likely to corrupt repository
  fast-export: ensure we traverse commits in topological order
  Clear the delta base cache if a pack is rebuilt

15 years agoMake repack less likely to corrupt repository
Junio C Hamano [Tue, 10 Feb 2009 20:16:31 +0000 (12:16 -0800)] 
Make repack less likely to corrupt repository

Some platforms refuse to rename a file that is open.  When repacking an
already packed repository without adding any new object, the resulting
pack will contain the same set of objects as an existing pack, and on such
platforms, a newly created packfile cannot replace the existing one.

The logic detected this issue but did not try hard enough to recover from
it.  Especially because the files that needs renaming come in pairs, there
potentially are different failure modes that one can be renamed but the
others cannot.  Asking manual recovery to end users were error prone.

This patch tries to make it more robust by first making sure all the
existing files that need to be renamed have been renamed before
continuing, and attempts to roll back if some failed to rename.

This is based on an initial patch by Robin Rosenberg.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-export: ensure we traverse commits in topological order
Elijah Newren [Wed, 11 Feb 2009 06:03:53 +0000 (23:03 -0700)] 
fast-export: ensure we traverse commits in topological order

fast-export will only list as parents those commits which have already
been traversed (making it appear as if merges have been squashed if not
all parents have been traversed).  To avoid this silent squashing of
merge commits, we request commits in topological order.

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoClear the delta base cache if a pack is rebuilt
Shawn O. Pearce [Wed, 11 Feb 2009 18:15:30 +0000 (10:15 -0800)] 
Clear the delta base cache if a pack is rebuilt

There is some risk that re-opening a regenerated pack file with
different offsets could leave stale entries within the delta base
cache that could be matched up against other objects using the same
"struct packed_git*" and pack offset.

Throwing away the entire delta base cache in this case is safer,
as we don't have to worry about a recycled "struct packed_git*"
matching to the wrong base object, resulting in delta apply
errors while unpacking an object.

Suggested-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.5.6' into maint
Junio C Hamano [Wed, 11 Feb 2009 10:00:07 +0000 (02:00 -0800)] 
Merge branch 'maint-1.5.6' into maint

* maint-1.5.6:
  revision traversal and pack: notice and die on missing commit

15 years agoMerge branch 'maint-1.5.5' into maint-1.5.6
Junio C Hamano [Wed, 11 Feb 2009 09:41:22 +0000 (01:41 -0800)] 
Merge branch 'maint-1.5.5' into maint-1.5.6

* maint-1.5.5:
  revision traversal and pack: notice and die on missing commit

Conflicts:
revision.c

15 years agoMerge branch 'maint-1.5.4' into maint-1.5.5
Junio C Hamano [Wed, 11 Feb 2009 09:40:12 +0000 (01:40 -0800)] 
Merge branch 'maint-1.5.4' into maint-1.5.5

* maint-1.5.4:
  revision traversal and pack: notice and die on missing commit

15 years agorevision traversal and pack: notice and die on missing commit
Junio C Hamano [Wed, 11 Feb 2009 09:27:43 +0000 (01:27 -0800)] 
revision traversal and pack: notice and die on missing commit

cc0e6c5 (Handle return code of parse_commit in revision machinery,
2007-05-04) attempted to tighten error checking in the revision machinery,
but it wasn't enough.  When get_revision_1() was asked for the next commit
to return, it tries to read and simplify the parents of the commit to be
returned, but an error while doing so was silently ignored and reported as
a truncated history to the caller instead.

This resulted in an early end of "git log" output or a pack that lacks
older commits from "git pack-objects", without any error indication in the
exit status from these commands, even though the underlying parse_commit()
issues an error message to the end user.

Note that the codepath in add_parents_list() that paints parents of an
UNINTERESTING commit UNINTERESTING silently ignores the error when
parse_commit() fails; this is deliberate and in line with aeeae1b
(revision traversal: allow UNINTERESTING objects to be missing,
2009-01-27).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Tue, 10 Feb 2009 23:32:26 +0000 (15:32 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  Clear the delta base cache during fast-import checkpoint

15 years agoClear the delta base cache during fast-import checkpoint
Shawn O. Pearce [Tue, 10 Feb 2009 21:36:12 +0000 (13:36 -0800)] 
Clear the delta base cache during fast-import checkpoint

Otherwise we may reuse the same memory address for a totally
different "struct packed_git", and a previously cached object from
the prior occupant might be returned when trying to unpack an object
from the new pack.

Found-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: add $prevent_xss option to prevent XSS by repository content
Matt McCutchen [Sun, 8 Feb 2009 00:00:09 +0000 (19:00 -0500)] 
gitweb: add $prevent_xss option to prevent XSS by repository content

Add a gitweb configuration variable $prevent_xss that disables features
to prevent content in repositories from launching cross-site scripting
(XSS) attacks in the gitweb domain.  Currently, this option makes gitweb
ignore README.html (a better solution may be worked out in the future)
and serve a blob_plain file of an untrusted type with
"Content-Disposition: attachment", which tells the browser not to show
the file at its original URL.

The XSS prevention is currently off by default.

Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorev-list: fix showing distance when using --bisect-all
Christian Couder [Sun, 8 Feb 2009 14:54:47 +0000 (15:54 +0100)] 
rev-list: fix showing distance when using --bisect-all

Before d467a52 ("Make '--decorate' set an explicit 'show_decorations'
flag", Nov 3 2008), commit decorations were shown whenever they exist, and
distances stored in them by "git rev-list --bisect-all" were automatically
shown.  d467a52 changed the rule so that commit decorations are not shown
unless rev_info explicitly asks to, with its show_decorations bit, but
forgot that the ones "git rev-list --bisect-all" adds need to be shown.

This patch fixes this old breakage.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove unused normalize_absolute_path()
Johannes Sixt [Sat, 7 Feb 2009 15:08:31 +0000 (16:08 +0100)] 
Remove unused normalize_absolute_path()

This function is now superseded by normalize_path_copy().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTest and fix normalize_path_copy()
Johannes Sixt [Sat, 7 Feb 2009 15:08:30 +0000 (16:08 +0100)] 
Test and fix normalize_path_copy()

This changes the test-path-utils utility to invoke normalize_path_copy()
instead of normalize_absolute_path() because the latter is about to be
removed.

The test cases in t0060 are adjusted in two regards:

- normalize_path_copy() more often leaves a trailing slash in the result.
  This has no negative side effects because the new user of this function,
  longest_ancester_length(), already accounts for this behavior.

- The function can fail.

The tests uncover a flaw in normalize_path_copy(): If there are
sufficiently many '..' path components so that the root is reached, such as
in "/d1/s1/../../d2", then the leading slash was lost. This manifested
itself that (assuming there is a repository at /tmp/foo)

  $ git add /d1/../tmp/foo/some-file

reported 'pathspec is outside repository'. This is now fixed.

Moreover, the test case descriptions of t0060 now include the test data and
expected outcome.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix GIT_CEILING_DIRECTORIES on Windows
René Scharfe [Sat, 7 Feb 2009 15:08:29 +0000 (16:08 +0100)] 
Fix GIT_CEILING_DIRECTORIES on Windows

Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed
assertion in normalize_absolute_path(): This function expects absolute
paths to start with a slash, while on Windows they can start with a drive
letter or a backslash.

This fixes it by using the alternative, normalize_path_copy() instead,
which can handle Windows-style paths just fine.

Secondly, the portability macro PATH_SEP is used instead of expecting
colons to be used as path list delimiter.

The test script t1504 is also changed to help MSYS's bash recognize some
program arguments as path list. (MSYS's bash must translate POSIX-style
path lists to Windows-style path lists, and the heuristic did not catch
some cases.)

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMove sanitary_path_copy() to path.c and rename it to normalize_path_copy()
Johannes Sixt [Sat, 7 Feb 2009 15:08:28 +0000 (16:08 +0100)] 
Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()

This function and normalize_absolute_path() do almost the same thing. The
former already works on Windows, but the latter crashes.

In subsequent changes we will remove normalize_absolute_path(). Here we
make the replacement function reusable. On the way we rename it to reflect
that it does some path normalization. Apart from that this is only moving
around code.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake test-path-utils more robust against incorrect use
Johannes Sixt [Sat, 7 Feb 2009 15:08:27 +0000 (16:08 +0100)] 
Make test-path-utils more robust against incorrect use

Previously, this test utility happily returned with exit code 0 if garbage
was thrown at it. Now it reports failure if an unknown function name was
given on the command line.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.6.1.3 v1.6.1.3
Junio C Hamano [Sat, 7 Feb 2009 08:51:47 +0000 (00:51 -0800)] 
GIT 1.6.1.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Fri, 6 Feb 2009 03:38:58 +0000 (19:38 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  Fixed broken git help -w when installing from RPM

15 years agoMerge branch 'jc/maint-apply-fix' into maint
Junio C Hamano [Fri, 6 Feb 2009 02:06:11 +0000 (18:06 -0800)] 
Merge branch 'jc/maint-apply-fix' into maint

* jc/maint-apply-fix:
  builtin-apply.c: do not set bogus mode in check_preimage() for deleted path

15 years agoMerge branch 'am/maint-push-doc' into maint
Junio C Hamano [Fri, 6 Feb 2009 02:06:03 +0000 (18:06 -0800)] 
Merge branch 'am/maint-push-doc' into maint

* am/maint-push-doc:
  Documentation: rework src/dst description in git push
  Documentation: more git push examples
  Documentation: simplify refspec format description

15 years agoMerge branch 'sg/maint-gitdir-in-subdir' into maint
Junio C Hamano [Fri, 6 Feb 2009 02:05:43 +0000 (18:05 -0800)] 
Merge branch 'sg/maint-gitdir-in-subdir' into maint

* sg/maint-gitdir-in-subdir:
  Fix gitdir detection when in subdir of gitdir

15 years agoMerge branch 'lt/maint-wrap-zlib' into maint
Junio C Hamano [Fri, 6 Feb 2009 02:01:00 +0000 (18:01 -0800)] 
Merge branch 'lt/maint-wrap-zlib' into maint

* lt/maint-wrap-zlib:
  Wrap inflate and other zlib routines for better error reporting

Conflicts:
http-push.c
http-walker.c
sha1_file.c

15 years agoMerge branch 'jc/maint-split-diff-metainfo' into maint
Junio C Hamano [Fri, 6 Feb 2009 01:54:17 +0000 (17:54 -0800)] 
Merge branch 'jc/maint-split-diff-metainfo' into maint

* jc/maint-split-diff-metainfo:
  diff.c: output correct index lines for a split diff

15 years agoMerge branch 'js/maint-all-implies-HEAD' into maint
Junio C Hamano [Fri, 6 Feb 2009 01:54:12 +0000 (17:54 -0800)] 
Merge branch 'js/maint-all-implies-HEAD' into maint

* js/maint-all-implies-HEAD:
  bundle: allow the same ref to be given more than once
  revision walker: include a detached HEAD in --all

15 years agoMerge branch 'kc/maint-diff-bwi-fix' into maint
Junio C Hamano [Fri, 6 Feb 2009 01:52:22 +0000 (17:52 -0800)] 
Merge branch 'kc/maint-diff-bwi-fix' into maint

* kc/maint-diff-bwi-fix:
  Fix combined use of whitespace ignore options to diff
  test more combinations of ignore-whitespace options to diff

15 years agofilter-branch: do not consider diverging submodules a 'dirty worktree'
Johannes Schindelin [Thu, 5 Feb 2009 18:19:33 +0000 (19:19 +0100)] 
filter-branch: do not consider diverging submodules a 'dirty worktree'

At the end of filter-branch in a non-bare repository, the work tree is
updated with "read-tree -m -u HEAD", to carry the change forward in case
the current branch was rewritten.  In order to avoid losing any local
change during this step, filter-branch refuses to work when there are
local changes in the work tree.

This "read-tree -m -u HEAD" operation does not affect what commit is
checked out in a submodule (iow, it does not touch .git/HEAD in a
submodule checkout), and checking if there is any local change to the
submodule is not useful.

Staged submodules _are_ considered to be 'dirty', however,  as the
"read-tree -m -u HEAD" could result in loss of staged information
otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFixed broken git help -w when installing from RPM
David J. Mellor [Thu, 5 Feb 2009 04:14:29 +0000 (20:14 -0800)] 
Fixed broken git help -w when installing from RPM

After the git-core package was renamed to git, git help -w was still looking
for files in /usr/share/doc/git-core-$VERSION instead of
/usr/share/doc/git-$VERSION.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-blame.c: Use utf8_strwidth for author's names
Geoffrey Thomas [Fri, 30 Jan 2009 09:41:29 +0000 (04:41 -0500)] 
builtin-blame.c: Use utf8_strwidth for author's names

git blame misaligns output if a author's name has a differing display width and
strlen; for instance, an accented Latin letter that takes two bytes to encode
will cause the rest of the line to be shifted to the left by one. To fix this,
use utf8_strwidth instead of strlen (and compute the padding ourselves, since
printf doesn't know about UTF-8).

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoutf8: add utf8_strwidth()
Geoffrey Thomas [Fri, 30 Jan 2009 09:41:28 +0000 (04:41 -0500)] 
utf8: add utf8_strwidth()

I'm about to use this pattern more than once, so make it a common function.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agourls.txt: document optional port specification in git URLS
Stefan Naewe [Wed, 4 Feb 2009 20:49:35 +0000 (21:49 +0100)] 
urls.txt: document optional port specification in git URLS

Signed-off-by: Stefan Naewe <stefan.naewe+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 4 Feb 2009 19:49:07 +0000 (11:49 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  builtin-mv.c: check for unversionned files before looking at the destination.
  Add a testcase for "git mv -f" on untracked files.
  Missing && in t/t7001.sh.

15 years agobuiltin-mv.c: check for unversionned files before looking at the destination.
Matthieu Moy [Wed, 4 Feb 2009 09:32:08 +0000 (10:32 +0100)] 
builtin-mv.c: check for unversionned files before looking at the destination.

The previous code was failing in the case where one moves an
unversionned file to an existing destination, with mv -f: the
"existing destination" was checked first, and the error was cancelled
by the force flag.

We now check the unrecoverable error first, which fixes the bug.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd a testcase for "git mv -f" on untracked files.
Matthieu Moy [Wed, 4 Feb 2009 09:32:07 +0000 (10:32 +0100)] 
Add a testcase for "git mv -f" on untracked files.

This currently fails with:
git: builtin-mv.c:217: cmd_mv: Assertion `pos >= 0' failed.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMissing && in t/t7001.sh.
Matthieu Moy [Wed, 4 Feb 2009 09:32:06 +0000 (10:32 +0100)] 
Missing && in t/t7001.sh.

Without this, the exit status is only the one of the last line.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-remote: make rm operation safer in mirrored repository
Jay Soffian [Wed, 4 Feb 2009 16:06:07 +0000 (11:06 -0500)] 
builtin-remote: make rm operation safer in mirrored repository

"git remote rm <repo>" happily removes non-remote refs and their reflogs.
This may be okay if the repository truely is a mirror, but if the user
had done "git remote add --mirror <repo>" by accident and was just
undoing their mistake, then they are left in a situation that is
difficult to recover from.

After this commit, "git remote rm" skips over non-remote refs. The user
is advised on how remove branches using "git branch -d", which itself
has nice safety checks wrt to branch removal lacking from "git remote rm".
Non-remote non-branch refs are skipped silently.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 4 Feb 2009 07:50:09 +0000 (23:50 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  User-manual: "git stash <comment>" form is long gone
  add test-dump-cache-tree in Makefile
  fix typo in Documentation
  apply: fix access to an uninitialized mode variable, found by valgrind

15 years agoUser-manual: "git stash <comment>" form is long gone
William Pursell [Tue, 3 Feb 2009 22:41:14 +0000 (22:41 +0000)] 
User-manual: "git stash <comment>" form is long gone

These days you must explicitly say "git stash save <comment>".

Signed-off-by: William Pursell <bill.pursell@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd test-dump-cache-tree in Makefile
Guanqun Lu [Wed, 4 Feb 2009 21:00:41 +0000 (05:00 +0800)] 
add test-dump-cache-tree in Makefile

5c5ba73 (Makefile: Use generic rule to build test programs,
2007-05-31) tried to use generic rule to build test programs, but it
misses the file 'dump-cache-tree.c', since its name is not prefixed by
'test-'.  This commit solves this little problem by renaming this file
instead of carrying out an explicit rule in Makefile.

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix typo in Documentation
Guanqun Lu [Wed, 4 Feb 2009 21:00:40 +0000 (05:00 +0800)] 
fix typo in Documentation

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply: fix access to an uninitialized mode variable, found by valgrind
Johannes Schindelin [Wed, 4 Feb 2009 01:50:15 +0000 (02:50 +0100)] 
apply: fix access to an uninitialized mode variable, found by valgrind

When 'tpatch' was initialized successfully, st_mode was already taken
from the previous diff.  We should not try to override it with data
from an lstat() that was never called.

This is a companion patch to 7a07841(git-apply: handle a patch that
touches the same path more than once better).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofilter-branch: Fix fatal error on bare repositories
Eric Kidd [Tue, 3 Feb 2009 18:27:03 +0000 (13:27 -0500)] 
filter-branch: Fix fatal error on bare repositories

When git filter-branch is run on a bare repository, it prints out a fatal
error message:

  $ git filter-branch branch
  Rewrite 476c4839280c219c2317376b661d9d95c1727fc3 (9/9)
  WARNING: Ref 'refs/heads/branch' is unchanged
  fatal: This operation must be run in a work tree

Note that this fatal error message doesn't prevent git filter-branch from
exiting successfully. (Why doesn't git filter-branch actually exit with an
error when a shell command fails? I'm not sure why it was designed this
way.)

This error message is caused by the following section of code at the end of
git-filter-branch.sh:

  if [ "$(is_bare_repository)" = false ]; then
          unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
          test -z "$ORIG_GIT_DIR" || {
                  GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
          }
          ... elided ...
          git read-tree -u -m HEAD
  fi

The problem is the call to $(is_bare_repository), which is made before
GIT_DIR and GIT_WORK_TREE are restored.  This call always returns "false",
even when we're running in a bare repository.  But this means that we will
attempt to call 'git read-tree' even in a bare repository, which will fail
and print an error.

This patch modifies git-filter-branch.sh to restore the original
environment variables before trying to call is_bare_repository.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-remote: make rm() use properly named variable to hold return value
Jay Soffian [Tue, 3 Feb 2009 17:51:12 +0000 (12:51 -0500)] 
builtin-remote: make rm() use properly named variable to hold return value

"i" is a loop counter and should not be used to hold a return value; use
"result" instead which is consistent with the rest of builtin-remote.c.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Tue, 3 Feb 2009 08:32:29 +0000 (00:32 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  grep: pass -I (ignore binary) down to external grep

15 years agogrep: pass -I (ignore binary) down to external grep
Junio C Hamano [Mon, 2 Feb 2009 18:58:20 +0000 (10:58 -0800)] 
grep: pass -I (ignore binary) down to external grep

We forgot to pass this option to the external grep process.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Sun, 1 Feb 2009 01:42:17 +0000 (17:42 -0800)] 
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  merge: fix out-of-bounds memory access

15 years agomerge: fix out-of-bounds memory access
René Scharfe [Sat, 31 Jan 2009 14:39:10 +0000 (15:39 +0100)] 
merge: fix out-of-bounds memory access

The parameter n of unpack_callback() can have a value of up to
MAX_UNPACK_TREES.  The check at the top of unpack_trees() (its only
(indirect) caller) makes sure it cannot exceed this limit.

unpack_callback() passes it and the array src to unpack_nondirectories(),
which has this loop:

for (i = 0; i < n; i++) {
/* ... */
src[i + o->merge] = o->df_conflict_entry;

o->merge can be 0 or 1, so unpack_nondirectories() potentially accesses
the array src at index MAX_UNPACK_TREES.  This patch makes it big enough.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>