Code

git.git
14 years agoMerge branch 'jc/maint-refs-dangling' into maint
Junio C Hamano [Wed, 31 Mar 2010 22:09:32 +0000 (15:09 -0700)]
Merge branch 'jc/maint-refs-dangling' into maint

* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref

14 years agoDocumentation: show-ref <pattern>s are optional
Holger Weiß [Mon, 29 Mar 2010 11:02:37 +0000 (13:02 +0200)]
Documentation: show-ref <pattern>s are optional

Specifying one or more <pattern> parameters is optional when calling
show-ref, so mark them as such using brackets in the manual.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoLink against libiconv on IRIX
Holger Weiß [Mon, 29 Mar 2010 10:57:48 +0000 (12:57 +0200)]
Link against libiconv on IRIX

On IRIX, "-liconv" must be added to the linker command line in order to
get iconv(3) support; set the according Makefile variable appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDon't redefine htonl and ntohl on big-endian
Holger Weiß [Mon, 29 Mar 2010 10:22:19 +0000 (12:22 +0200)]
Don't redefine htonl and ntohl on big-endian

Since commit 0fcabdeb52b79775173d009ccc179db104dfbb66, compat/bswap.h
redefined htonl and ntohl to bswap32 not only if bswap32 has been
defined earlier in compat/bswap.h (which is done only on selected
platforms), but also if bswap32 has been defined anywhere else.  This
broke Git at least for NetBSD systems running on big-endian machines
(where ntohl and htonl should, of course, be NOOPs), since NetBSD
defines a bswap32 macro in the system headers.

So, we now undefine any previously defined bswap32 in compat/bswap.h
before defining our own.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: git_get_project_config requires only $git_dir, not also $project
Jakub Narebski [Sat, 27 Mar 2010 19:26:59 +0000 (20:26 +0100)]
gitweb: git_get_project_config requires only $git_dir, not also $project

Fix overeager early return in git_get_project_config, introduced in 9be3614
(gitweb: Fix project-specific feature override behavior, 2010-03-01).  When
git_get_project_config is called from projects list page via
git_get_project_owner($path) etc., it is called with $git_dir defined (in
git_get_project_owner($path) etc.), but $project variable is not defined.
git_get_project_config doesn't use $project variable anyway.

Reported-by: Tobias Heinlein <keytoaster@gentoo.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdated the usage string of git reset
Jan Stępień [Wed, 31 Mar 2010 09:24:19 +0000 (11:24 +0200)]
Updated the usage string of git reset

Make git reset usage string reflect the command's behaviour and contents of
the man page.

Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: Clarify support for smart HTTP backend
Greg Bacon [Tue, 30 Mar 2010 17:20:57 +0000 (12:20 -0500)]
Documentation: Clarify support for smart HTTP backend

In the description of http.getanyfile, replace the vague "older Git
clients" with the earliest release whose client is able to use the
upload pack service.

Signed-off-by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoWindows: fix utime() for read-only files
Johannes Sixt [Tue, 30 Mar 2010 07:46:23 +0000 (09:46 +0200)]
Windows: fix utime() for read-only files

Starting with 5256b00 (Use git_mkstemp_mode instead of plain mkstemp to
create object files, 2010-02-22) utime() is invoked on read-only files.
This is not allowed on Windows and results in many warnings of the form

failed utime() on .git/objects/23/tmp_obj_VlgHlc: Permission denied

during a repack.  Fix it by making the file temporarily writable.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff: fix textconv error zombies
Johannes Sixt [Tue, 30 Mar 2010 17:36:03 +0000 (19:36 +0200)]
diff: fix textconv error zombies

To make the code simpler, run_textconv lumps all of its
error checking into one conditional. However, the
short-circuit means that an error in reading will prevent us
from calling finish_command, leaving a zombie child.
Clean up properly after errors.

Based-on-work-by: Jeff King <peff@peff.net>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoformat-patch: Squelch 'fatal: Not a range." error
Kevin Ballard [Tue, 30 Mar 2010 02:46:38 +0000 (19:46 -0700)]
format-patch: Squelch 'fatal: Not a range." error

Don't output an error on `git format-patch --ignore-if-in-upstream HEAD`.
This matches the behavior of `git format-patch HEAD`.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoPrepare for 1.7.0.4
Junio C Hamano [Mon, 29 Mar 2010 04:32:25 +0000 (21:32 -0700)]
Prepare for 1.7.0.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'cp/add-u-pathspec' into maint
Junio C Hamano [Mon, 29 Mar 2010 04:21:42 +0000 (21:21 -0700)]
Merge branch 'cp/add-u-pathspec' into maint

* cp/add-u-pathspec:
  test for add with non-existent pathspec
  git add -u: die on unmatched pathspec

14 years agot9350: fix careless use of "cd"
Junio C Hamano [Mon, 29 Mar 2010 00:42:11 +0000 (17:42 -0700)]
t9350: fix careless use of "cd"

Upon failure of any of these tests (or when a test that is marked as
expecting a failure is fixed), we will end up running later tests in
random places.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodifftool: Fix '--gui' when diff.guitool is unconfigured
David Aguilar [Sat, 27 Mar 2010 21:58:09 +0000 (14:58 -0700)]
difftool: Fix '--gui' when diff.guitool is unconfigured

When diff.guitool is unconfigured and "--gui" is specified
git-difftool dies with the following error message:

config diff.guitool: command returned error: 1

Catch the error so that the "--gui" flag is a no-op when
diff.guitool is unconfigured.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-export: don't segfault when marks file cannot be opened
Sverre Rabbelier [Sun, 28 Mar 2010 05:42:48 +0000 (00:42 -0500)]
fast-export: don't segfault when marks file cannot be opened

The error function only prints an error message, resulting in a
segfault if we later on try to fprintf to a NULL handle.

Fix this by using die_errno instead.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jc/color-attrs' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:24:13 +0000 (16:24 -0700)]
Merge branch 'jc/color-attrs' into maint

* jc/color-attrs:
  color: allow multiple attributes

14 years agoMerge branch 'jk/maint-add-ignored-dir' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:24:03 +0000 (16:24 -0700)]
Merge branch 'jk/maint-add-ignored-dir' into maint

* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such

14 years agoMerge branch 'bg/apply-fix-blank-at-eof' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:23:50 +0000 (16:23 -0700)]
Merge branch 'bg/apply-fix-blank-at-eof' into maint

* bg/apply-fix-blank-at-eof:
  t3417: Add test cases for "rebase --whitespace=fix"
  t4124: Add additional tests of --whitespace=fix
  apply: Allow blank context lines to match beyond EOF
  apply: Remove the quick rejection test
  apply: Don't unnecessarily update line lengths in the preimage

14 years agoDocumentation: explain the meaning of "-g" in git-describe output
Markus Heidelberg [Mon, 22 Mar 2010 20:45:33 +0000 (21:45 +0100)]
Documentation: explain the meaning of "-g" in git-describe output

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.7.0.3 v1.7.0.3
Junio C Hamano [Mon, 22 Mar 2010 00:01:22 +0000 (17:01 -0700)]
Git 1.7.0.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Mon, 22 Mar 2010 00:00:22 +0000 (17:00 -0700)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  Documentation/git-clone: Transform description list into item list
  Documentation/urls: Remove spurious example markers
  Documentation/gitdiffcore: Remove misleading date in heading
  Documentation/git-reflog: Fix formatting of command lists

14 years ago.mailmap: Map the the first submissions of MJG by e-mail
Michael J Gruber [Sun, 21 Mar 2010 13:43:47 +0000 (14:43 +0100)]
.mailmap: Map the the first submissions of MJG by e-mail

so that git shortlog with '-e' coalesces all my commits.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-clone: Transform description list into item list
Michael J Gruber [Sun, 21 Mar 2010 17:30:19 +0000 (18:30 +0100)]
Documentation/git-clone: Transform description list into item list

so that the list of examples is formatted in the same way as for
git-fetch, and, more importantly, the different identation for the
code blocks in the examples (compared to the immediately preceding code
blocks from url.txt) doesn't look like misformatted, but is clarified by
the items' bullets.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/urls: Remove spurious example markers
Michael J Gruber [Sun, 21 Mar 2010 17:30:18 +0000 (18:30 +0100)]
Documentation/urls: Remove spurious example markers

In urls.txt (which is included from git-{clone,fetch,push}.txt)
several item lists are surrounded by example block markers. This is
problematic for two reasons:

- None of these lists are example lists, so they should not be marked as
  such semantically.
- The html output looks weird (bulleted list with left sidebar).

Therefore, remove the example block markers. Output by the man backend
is unaffected.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/gitdiffcore: Remove misleading date in heading
Michael J Gruber [Sun, 21 Mar 2010 17:30:17 +0000 (18:30 +0100)]
Documentation/gitdiffcore: Remove misleading date in heading

Ever since the automatic conversion into man form, the heading
contained a misidentified subheading reading "June 2005".
Remove this since the documentation is more recent, and the correct
date is in the footer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-reflog: Fix formatting of command lists
Michael J Gruber [Sun, 21 Mar 2010 17:30:16 +0000 (18:30 +0100)]
Documentation/git-reflog: Fix formatting of command lists

A misplaced list continuation mark appears literally in the
rendered doc. Fix this by removing it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate draft release notes to 1.7.0.3
Junio C Hamano [Sat, 20 Mar 2010 18:29:13 +0000 (11:29 -0700)]
Update draft release notes to 1.7.0.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Fix minor memory leak
Andreas Gruenbacher [Mon, 15 Mar 2010 22:18:48 +0000 (23:18 +0100)]
fetch: Fix minor memory leak

A temporary struct ref is allocated in store_updated_refs() but not
freed.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Future-proof initialization of a refspec on stack
Andreas Gruenbacher [Fri, 12 Mar 2010 22:27:33 +0000 (23:27 +0100)]
fetch: Future-proof initialization of a refspec on stack

The open-coded version to initialize each and every member will break
when a new member is added to the structure.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Check for a "^{}" suffix with suffixcmp()
Andreas Gruenbacher [Sat, 13 Mar 2010 17:17:04 +0000 (18:17 +0100)]
fetch: Check for a "^{}" suffix with suffixcmp()

Otherwise, we will check random bytes for ref names < 3 characters.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodaemon: parse_host_and_port SIGSEGV if port is specified
Imre Deak [Sat, 20 Mar 2010 02:23:58 +0000 (04:23 +0200)]
daemon: parse_host_and_port SIGSEGV if port is specified

This typo will lead to git-daemon dying any time the connect
string includes a port after the host= attribute. This can lead
for example to one of the following error messages on the client
side when someone tries git clone git://...:<port>.

When the daemon is running on localhost:
  fatal: The remote end hung up unexpectedly

or when the daemon is connected through an ssh tunnel:
  fatal: protocol error: bad line length character: erro

In the latter case 'erro' comes from the daemon's reply:
  error: git-daemon died of signal 11

Signed-off-by: Imre Deak <imre.deak@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Fix CDPATH problem
Jonathan Nieder [Sat, 20 Mar 2010 00:06:15 +0000 (19:06 -0500)]
Makefile: Fix CDPATH problem

If CDPATH is set, "cd" prints its destination to stdout, causing
the common (cd a && tar cf - .) | (cd b && tar xf -) idiom to fail.
For example:

 make -C templates DESTDIR='' install
 make[1]: Entering directory `/users/e477610/exptool/src/git-1.7.0.2/templates'
 install -d -m 755 '/home/e477610/exptool/share/git-core/templates'
 (cd blt && gtar cf - .) | \
(cd '/home/e477610/exptool/share/git-core/templates' && umask 022 && gtar xof -)
 gtar: This does not look like a tar archive

Most git scripts already protect against use of CDPATH through
git-sh-setup, but the Makefile doesn’t.

Reported-by: Michael Cox <mhcox@bluezoosoftware.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopull: replace unnecessary sed invocation
Stephen Boyd [Thu, 18 Mar 2010 05:10:45 +0000 (22:10 -0700)]
pull: replace unnecessary sed invocation

Getting the shortened branch name is as easy as using the shell's
parameter expansion.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: receive.denyCurrentBranch defaults to 'refuse'
Thomas Rast [Wed, 17 Mar 2010 11:14:57 +0000 (12:14 +0100)]
Documentation: receive.denyCurrentBranch defaults to 'refuse'

acd2a45 (Refuse updating the current branch in a non-bare repository
via push, 2009-02-11) changed the default to refuse such a push, but
it forgot to update the docs.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobash: complete *_HEAD refs if present
Ian Ward Comfort [Wed, 17 Mar 2010 09:20:35 +0000 (02:20 -0700)]
bash: complete *_HEAD refs if present

We already complete HEAD, of course, and might as well complete the other
common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and
MERGE_HEAD.

Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorefs: ref entry with NULL sha1 is can be a dangling symref
Junio C Hamano [Tue, 16 Mar 2010 05:12:55 +0000 (22:12 -0700)]
refs: ref entry with NULL sha1 is can be a dangling symref

Brandon Casey noticed that t5505 had accidentally broken its && chain,
hiding inconsistency between the code that writes the warning to the
standard output and the test that expects to see the warning on the
standard error, which was introduced by f8948e2 (remote prune: warn
dangling symrefs, 2009-02-08).

It turns out that the issue is deeper than that.  After f8948e2, a symref
that is dangling is marked with a NULL sha1, and the idea of using NULL
sha1 to mean a deleted ref was scrapped, but somehow a follow-up eafb452
(do_one_ref(): null_sha1 check is not about broken ref, 2009-07-22)
incorrectly reorganized do_one_ref(), still thinking NULL sha1 is never
used in the code.

Fix this by:

 - adopt Brandon's fix to t5505 test;

 - introduce REF_BROKEN flag to mark a ref that fails to resolve (dangling
   symref);

 - move the check for broken ref back inside the "if we are skipping
   dangling refs" code block.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-read-tree: clarify 2-tree merge
Michael J Gruber [Mon, 15 Mar 2010 10:54:46 +0000 (11:54 +0100)]
Documentation/git-read-tree: clarify 2-tree merge

Clarify the description of the 2-tree merge by defining the terms
which are used in the table, and by applying some small linguistic
changes.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-read-tree: fix table layout
Michael J Gruber [Mon, 15 Mar 2010 10:54:45 +0000 (11:54 +0100)]
Documentation/git-read-tree: fix table layout

Asciidoc takes the first non-space character in the first line of the
paragraph as a reference point for preformatted layout, so adjust to
that to make the table align.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests for "git add ignored-dir/file" without -f
Junio C Hamano [Mon, 1 Mar 2010 03:12:31 +0000 (19:12 -0800)]
tests for "git add ignored-dir/file" without -f

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodir: fix COLLECT_IGNORED on excluded prefixes
Jeff King [Thu, 11 Mar 2010 07:15:43 +0000 (02:15 -0500)]
dir: fix COLLECT_IGNORED on excluded prefixes

As we walk the directory tree, if we see an ignored path, we
want to add it to the ignored list only if it matches any
pathspec that we were given. We used to check for the
pathspec to appear explicitly. E.g., if we see "subdir/file"
and it is excluded, we check to see if we have "subdir/file"
in our pathspec.

However, this interacts badly with the optimization to avoid
recursing into ignored subdirectories. If "subdir" as a
whole is ignored, then we never recurse, and consider only
whether "subdir" itself is in our pathspec.  It would not
match a pathspec of "subdir/file" explicitly, even though it
is the reason that subdir/file would be excluded.

This manifests itself to the user as "git add subdir/file"
failing to correctly note that the pathspec was ignored.

This patch extends the in_pathspec logic to include prefix
directory case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot0050: mark non-working test as such
Junio C Hamano [Mon, 1 Mar 2010 07:31:21 +0000 (23:31 -0800)]
t0050: mark non-working test as such

The test is to prepare an empty file "camelcase" in the index, remove
and replace it with another file "CamelCase" with "1" as its contents
in the working tree, and add it to the index, in a repository configured
to be case insensitive.

However, the test actually checked ls-files knows about a pathname that
matches "camelcase" case insensitively.  It didn't check if the added
contents actually was the updated one.

Mark the test as non-working.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodon't use default revision if a rev was specified
Dave Olszewski [Sat, 13 Mar 2010 22:47:05 +0000 (14:47 -0800)]
don't use default revision if a rev was specified

If a revision is specified, it happens not to have any commits, don't
use the default revision.  By doing so, surprising and undesired
behavior can happen, such as showing the reflog for HEAD when a branch
was specified.

[jc: squashed a test from René]

Signed-off-by: Dave Olszewski <cxreg@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofor_each_recent_reflog_ent(): use strbuf, fix offset handling
René Scharfe [Sat, 13 Mar 2010 17:37:50 +0000 (18:37 +0100)]
for_each_recent_reflog_ent(): use strbuf, fix offset handling

As Vladimir reported, "git log -g refs/stash" surprisingly showed the reflog
of HEAD if the message in the reflog file was too long.  To fix this, convert
for_each_recent_reflog_ent() to use strbuf_getwholeline() instead of fgets(),
for safety and to avoid any size limits for reflog entries.

Also reverse the logic of the part of the function that only looks at file
tails.  It used to close the file if fgets() succeeded.  The following
fgets() call in the while loop was likely to fail in this case, too, so
passing an offset to for_each_recent_reflog_ent() never worked.  Change it to
error out if strbuf_getwholeline() fails instead.

Reported-by: Vladimir Panteleev <vladimir@thecybershadow.net>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/Makefile: remove test artifacts upon "make clean"
Junio C Hamano [Sat, 13 Mar 2010 20:41:20 +0000 (12:41 -0800)]
t/Makefile: remove test artifacts upon "make clean"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoblame: fix indent of line numbers
René Scharfe [Sat, 13 Mar 2010 10:25:12 +0000 (11:25 +0100)]
blame: fix indent of line numbers

Correct the calculation of the number of digits for line counts of the
form 10^n-1 (9, 99, ...) in lineno_width().  This makes blame stop
printing an extra space before the line numbers of files with that many
total lines.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot9400: Use test_cmp when appropriate
Junio C Hamano [Fri, 12 Mar 2010 05:40:33 +0000 (21:40 -0800)]
t9400: Use test_cmp when appropriate

Consistently using test_cmp would make debugging test scripts far easier,
as output from them run under "-v" option becomes readable.

Besides, some platforms' "diff" implementations lack "-q" option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge accumulated fixes to prepare for 1.7.0.3
Junio C Hamano [Mon, 8 Mar 2010 08:50:24 +0000 (00:50 -0800)]
Merge accumulated fixes to prepare for 1.7.0.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'mw/maint-gcc-warns-unused-write' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:02 +0000 (00:36 -0800)]
Merge branch 'mw/maint-gcc-warns-unused-write' into maint

* mw/maint-gcc-warns-unused-write:
  run-command.c: fix build warnings on Ubuntu

14 years agoMerge branch 'fn/maint-mkdtemp-compat' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:02 +0000 (00:36 -0800)]
Merge branch 'fn/maint-mkdtemp-compat' into maint

* fn/maint-mkdtemp-compat:
  Fix gitmkdtemp: correct test for mktemp() return value

14 years agoMerge branch 'gb/maint-submodule-env' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:02 +0000 (00:36 -0800)]
Merge branch 'gb/maint-submodule-env' into maint

* gb/maint-submodule-env:
  is_submodule_modified(): clear environment properly
  submodules: ensure clean environment when operating in a submodule
  shell setup: clear_local_git_env() function
  rev-parse: --local-env-vars option
  Refactor list of of repo-local env vars

14 years agoMerge branch 'as/maint-expire' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:01 +0000 (00:36 -0800)]
Merge branch 'as/maint-expire' into maint

* as/maint-expire:
  reflog: honor gc.reflogexpire=never
  prune: honor --expire=never

14 years agoMerge branch 'ml/maint-grep-doc' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:01 +0000 (00:36 -0800)]
Merge branch 'ml/maint-grep-doc' into maint

* ml/maint-grep-doc:
  grep docs: document --no-index option
  grep docs: --cached and <tree>... are incompatible
  grep docs: use AsciiDoc literals consistently
  grep docs: pluralize "Example" section

14 years agoMerge branch 'jk/maint-push-tracking-wo-remote' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:01 +0000 (00:36 -0800)]
Merge branch 'jk/maint-push-tracking-wo-remote' into maint

* jk/maint-push-tracking-wo-remote:
  push: fix segfault for odd config

14 years agoMerge branch 'jc/fetch-param' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:00 +0000 (00:36 -0800)]
Merge branch 'jc/fetch-param' into maint

* jc/fetch-param:
  fetch --all/--multiple: keep all the fetched branch information
  builtin-fetch --all/--multi: propagate options correctly
  t5521: fix and modernize

14 years agoMerge branch 'ne/pack-local-doc' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:00 +0000 (00:36 -0800)]
Merge branch 'ne/pack-local-doc' into maint

* ne/pack-local-doc:
  pack-objects documentation: Fix --honor-pack-keep as well.
  pack-objects documentation: reword "objects that appear in the standard input"
  Documentation: pack-objects: Clarify --local's semantics.

14 years agoMerge branch 'jk/maint-add--interactive-delete' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:00 +0000 (00:36 -0800)]
Merge branch 'jk/maint-add--interactive-delete' into maint

* jk/maint-add--interactive-delete:
  add-interactive: fix bogus diff header line ordering

14 years agoMerge branch 'mm/mkstemps-mode-for-packfiles' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:36:00 +0000 (00:36 -0800)]
Merge branch 'mm/mkstemps-mode-for-packfiles' into maint

* mm/mkstemps-mode-for-packfiles:
  Use git_mkstemp_mode instead of plain mkstemp to create object files
  git_mkstemps_mode: don't set errno to EINVAL on exit.
  Use git_mkstemp_mode and xmkstemp_mode in odb_mkstemp, not chmod later.
  git_mkstemp_mode, xmkstemp_mode: variants of gitmkstemps with mode argument.
  Move gitmkstemps to path.c
  Add a testcase for ACL with restrictive umask.

14 years agoMerge branch 'jc/maint-fix-mailinfo-strip' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:35:59 +0000 (00:35 -0800)]
Merge branch 'jc/maint-fix-mailinfo-strip' into maint

* jc/maint-fix-mailinfo-strip:
  mailinfo: do not strip leading spaces even for a header line

14 years agoMerge branch 'jc/grep-author-all-match-implicit' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:35:59 +0000 (00:35 -0800)]
Merge branch 'jc/grep-author-all-match-implicit' into maint

* jc/grep-author-all-match-implicit:
  "log --author=me --grep=it" should find intersection, not union

14 years agoMerge branch 'jc/checkout-detached' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:35:59 +0000 (00:35 -0800)]
Merge branch 'jc/checkout-detached' into maint

* jc/checkout-detached:
  Reword "detached HEAD" notification

14 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Mon, 8 Mar 2010 08:35:58 +0000 (00:35 -0800)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:

14 years agoMerge branch 'jc/maint-fix-test-perm' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:54:05 +0000 (14:54 -0800)]
Merge branch 'jc/maint-fix-test-perm' into maint-1.6.6

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

14 years agoMerge branch 'sp/maint-push-sideband' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:54:01 +0000 (14:54 -0800)]
Merge branch 'sp/maint-push-sideband' into maint-1.6.6

* sp/maint-push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

14 years agoMerge branch 'hm/maint-imap-send-crlf' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:57 +0000 (14:53 -0800)]
Merge branch 'hm/maint-imap-send-crlf' into maint-1.6.6

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

14 years agoMerge branch 'gf/maint-sh-setup-nongit-ok' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:53 +0000 (14:53 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok' into maint-1.6.6

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

14 years agoMerge branch 'jk/maint-rmdir-fix' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:50 +0000 (14:53 -0800)]
Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6

* jk/maint-rmdir-fix:
  rm: fix bug in recursive subdirectory removal

14 years agoMerge branch 'rs/optim-text-wrap' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:45 +0000 (14:53 -0800)]
Merge branch 'rs/optim-text-wrap' into maint-1.6.6

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

14 years agoMerge branch 'tr/maint-cherry-pick-list' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:40 +0000 (14:53 -0800)]
Merge branch 'tr/maint-cherry-pick-list' into maint-1.6.6

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

14 years agoMerge branch 'cc/maint-bisect-paths' into maint-1.6.6
Junio C Hamano [Sun, 7 Mar 2010 22:53:35 +0000 (14:53 -0800)]
Merge branch 'cc/maint-bisect-paths' into maint-1.6.6

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

14 years agocolor: allow multiple attributes
Junio C Hamano [Sun, 28 Feb 2010 02:56:38 +0000 (18:56 -0800)]
color: allow multiple attributes

In configuration files (and "git config --color" command line), we
supported one and only one attribute after foreground and background
color.  Accept combinations of attributes, e.g.

    [diff.color]
            old = red reverse bold

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.7.0.2 v1.7.0.2
Junio C Hamano [Sun, 7 Mar 2010 19:07:51 +0000 (11:07 -0800)]
Git 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agounset GREP_OPTIONS in test-lib.sh
Bert Wesarg [Wed, 18 Nov 2009 16:15:19 +0000 (17:15 +0100)]
unset GREP_OPTIONS in test-lib.sh

I used to set GREP_OPTIONS to exclude *.orig and *.rej files. But with this
the test t4252-am-options.sh fails because it calls grep with a .rej file:

    grep "@@ -1,3 +1,3 @@" file-2.rej

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3417: Add test cases for "rebase --whitespace=fix"
Björn Gustavsson [Sat, 6 Mar 2010 14:31:17 +0000 (15:31 +0100)]
t3417: Add test cases for "rebase --whitespace=fix"

The command "git rebase --whitespace=fix HEAD~<N>" is supposed to
only clean up trailing whitespace, and the expectation is that it
cannot fail.

Unfortunately, if one commit adds a blank line at the end of a file
and a subsequent commit adds more non-blank lines after the blank
line, "git apply" (used indirectly by "git rebase") will fail to apply
the patch of the second commit.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot4124: Add additional tests of --whitespace=fix
Björn Gustavsson [Sat, 6 Mar 2010 14:31:04 +0000 (15:31 +0100)]
t4124: Add additional tests of --whitespace=fix

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Allow blank context lines to match beyond EOF
Björn Gustavsson [Sat, 6 Mar 2010 14:30:42 +0000 (15:30 +0100)]
apply: Allow blank context lines to match beyond EOF

"git apply --whitespace=fix" will not always succeed when used
on a series of patches in the following circumstances:

* One patch adds a blank line at the end of a file. (Since
  --whitespace=fix is used, the blank line will *not* be added.)

* The next patch adds non-blank lines after the blank line
  introduced in the first patch. That patch will not apply
  because the blank line that is expected to be found at end
  of the file is no longer there.

A patch series that starts by deleting lines at the end
will fail in a similar way.

Fix this problem by allowing a blank context line at the beginning
of a hunk to match if parts of it falls beyond end of the file.
We still require that at least one non-blank context line match
before the end of the file.

If the --ignore-space-change option is given (as well as the
--whitespace=fix option), blank context lines falling beyond the end
of the file will be copied unchanged to the target file (i.e. they
will have the same line terminators and extra spaces will not be
removed).

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Remove the quick rejection test
Björn Gustavsson [Sat, 6 Mar 2010 14:30:29 +0000 (15:30 +0100)]
apply: Remove the quick rejection test

In the next commit, we will make it possible for blank context
lines to match beyond the end of the file. That means that a hunk
with a preimage that has more lines than present in the file may
be possible to successfully apply. Therefore, we must remove
the quick rejection test in find_pos().

find_pos() will already work correctly without the quick
rejection test, but that might not be obvious. Therefore,
comment the test for handling out-of-range line numbers in
find_pos() and cast the "line" variable to the same (unsigned)
type as img->nr.

What are performance implications of removing the quick
rejection test?

It can only help "git apply" to reject a patch faster. For example,
if I have a file with one million lines and a patch that removes
slightly more than 50 percent of the lines and try to apply that
patch twice, the second attempt will fail slightly faster
with the test than without (based on actual measurements).

However, there is the pathological case of a patch with many
more context lines than the default three, and applying that patch
using "git apply -C1". Without the rejection test, the running
time will be roughly proportional to the number of context lines
times the size of the file. That could be handled by writing
a more complicated rejection test (it would have to count the
number of blanks at the end of the preimage), but I don't find
that worth doing until there is a real-world use case that
would benfit from it.

It would be possible to keep the quick rejection test if
--whitespace=fix is not given, but I don't like that from
a testing point of view.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Don't unnecessarily update line lengths in the preimage
Björn Gustavsson [Sat, 6 Mar 2010 14:30:21 +0000 (15:30 +0100)]
apply: Don't unnecessarily update line lengths in the preimage

In match_fragment(), the line lengths in the preimage are updated
just before calling update_pre_post_images(). That is not
necessary, since update_pre_post_images() itself will
update the line lengths based on the buffer passed to it.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostash: suggest the correct command line for unknown options.
Matthieu Moy [Fri, 5 Mar 2010 18:43:23 +0000 (19:43 +0100)]
stash: suggest the correct command line for unknown options.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7406: Fix submodule init config tests
Stephen Boyd [Fri, 5 Mar 2010 08:20:38 +0000 (00:20 -0800)]
t7406: Fix submodule init config tests

These tests have been broken since they were introduced in commits
ca2cedb (git-submodule: add support for --rebase., 2009-04-24) and
42b4917 (git-submodule: add support for --merge., 2009-06-03).
'git submodule init' expects the submodules to exist in the index.
In this case, the submodules don't exist and therefore looking for
the submodules will always fail. To make matters worse, git submodule
fails visibly to the user by saying:

error: pathspec 'rebasing' did not match any file(s) known to git.
Did you forget to 'git add'?

but doesn't return an error code. This allows the test to fail silently.
Fix it by adding the submodules first.

Cc: Johan Herland <johan@herland.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate draft release notes to 1.7.0.2
Junio C Hamano [Fri, 5 Mar 2010 06:39:38 +0000 (22:39 -0800)]
Update draft release notes to 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jn/gitweb-config-error-die' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:27:12 +0000 (22:27 -0800)]
Merge branch 'jn/gitweb-config-error-die' into maint

* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file

14 years agoMerge branch 'jn/maint-fix-pager' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:27:04 +0000 (22:27 -0800)]
Merge branch 'jn/maint-fix-pager' into maint

* jn/maint-fix-pager:
  tests: Fix race condition in t7006-pager
  t7006-pager: if stdout is not a terminal, make a new one
  tests: Add tests for automatic use of pager
  am: Fix launching of pager
  git svn: Fix launching of pager
  git.1: Clarify the behavior of the --paginate option
  Make 'git var GIT_PAGER' always print the configured pager
  Fix 'git var' usage synopsis

14 years agoMerge branch 'tr/maint-cherry-pick-list' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:44 +0000 (22:26 -0800)]
Merge branch 'tr/maint-cherry-pick-list' into maint

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

14 years agoMerge branch 'ld/maint-diff-quiet-w' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:39 +0000 (22:26 -0800)]
Merge branch 'ld/maint-diff-quiet-w' into maint

* ld/maint-diff-quiet-w:
  git-diff: add a test for git diff --quiet -w
  git diff --quiet -w: check and report the status

14 years agoMerge branch 'rs/optim-text-wrap' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:33 +0000 (22:26 -0800)]
Merge branch 'rs/optim-text-wrap' into maint

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

14 years agoMerge branch 'dp/read-not-mmap-small-loose-object' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:17 +0000 (22:26 -0800)]
Merge branch 'dp/read-not-mmap-small-loose-object' into maint

* dp/read-not-mmap-small-loose-object:
  hash-object: don't use mmap() for small files

14 years agoMerge branch 'np/compress-loose-object-memsave' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:05 +0000 (22:26 -0800)]
Merge branch 'np/compress-loose-object-memsave' into maint

* np/compress-loose-object-memsave:
  sha1_file: be paranoid when creating loose objects
  sha1_file: don't malloc the whole compressed result when writing out objects

14 years agoMerge branch 'jc/maint-status-preload' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:45 +0000 (22:25 -0800)]
Merge branch 'jc/maint-status-preload' into maint

* jc/maint-status-preload:
  status: preload index to optimize lstat(2) calls

14 years agoMerge branch 'gf/maint-sh-setup-nongit-ok' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:37 +0000 (22:25 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok' into maint

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

14 years agoMerge branch 'cc/maint-bisect-paths' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:23 +0000 (22:25 -0800)]
Merge branch 'cc/maint-bisect-paths' into maint

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

14 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:24:25 +0000 (22:24 -0800)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  Remove extra '-' from git-am(1)

14 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Fri, 5 Mar 2010 06:24:19 +0000 (22:24 -0800)]
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  Remove extra '-' from git-am(1)

14 years agoRemove extra '-' from git-am(1)
Michal Sojka [Thu, 4 Mar 2010 12:08:28 +0000 (13:08 +0100)]
Remove extra '-' from git-am(1)

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorun-command.c: fix build warnings on Ubuntu
Michael Wookey [Fri, 29 Jan 2010 22:38:19 +0000 (09:38 +1100)]
run-command.c: fix build warnings on Ubuntu

Building git on Ubuntu 9.10 warns that the return value of write(2)
isn't checked. These warnings were introduced in commits:

  2b541bf8 ("start_command: detect execvp failures early")
  a5487ddf ("start_command: report child process setup errors to the
parent's stderr")

GCC details:

  $ gcc --version
  gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1

Silence the warnings by reading (but not making use of) the return value
of write(2).

Signed-off-by: Michael Wookey <michaelwookey@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoStart preparing for 1.7.0.2
Junio C Hamano [Wed, 3 Mar 2010 07:11:36 +0000 (23:11 -0800)]
Start preparing for 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'tc/maint-transport-ls-remote-with-void' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:55:22 +0000 (22:55 -0800)]
Merge branch 'tc/maint-transport-ls-remote-with-void' into maint

* tc/maint-transport-ls-remote-with-void:
  transport: add got_remote_refs flag

14 years agoMerge branch 'hm/maint-imap-send-crlf' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:55:03 +0000 (22:55 -0800)]
Merge branch 'hm/maint-imap-send-crlf' into maint

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

14 years agoMerge branch 'sp/maint-push-sideband' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:54:50 +0000 (22:54 -0800)]
Merge branch 'sp/maint-push-sideband' into maint

* sp/maint-push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

Conflicts:
builtin-receive-pack.c
run-command.c
t/t5401-update-hooks.sh

14 years agoMerge branch 'jc/maint-fix-test-perm' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:38:02 +0000 (22:38 -0800)]
Merge branch 'jc/maint-fix-test-perm' into maint

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

14 years agoMerge branch 'np/fast-import-idx-v2' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:28:49 +0000 (22:28 -0800)]
Merge branch 'np/fast-import-idx-v2' into maint

* np/fast-import-idx-v2:
  fast-import: use the diff_delta() max_delta_size argument
  fast-import: honor pack.indexversion and pack.packsizelimit config vars
  fast-import: make default pack size unlimited
  fast-import: use write_idx_file() instead of custom code
  fast-import: use sha1write() for pack data
  fast-import: start using struct pack_idx_entry