Commit graph

21411 commits

Author SHA1 Message Date
Johannes Sixt da1fbed3ff 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>
2010-03-30 14:46:33 -07:00
Kevin Ballard 657ab61efa 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>
2010-03-29 21:22:37 -07:00
Junio C Hamano e07665e524 Prepare for 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 21:32:25 -07:00
Junio C Hamano cc64c6970a 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
2010-03-28 21:21:42 -07:00
Junio C Hamano 4c367c6ae9 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>
2010-03-28 17:42:11 -07:00
David Aguilar 42accaec01 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>
2010-03-28 09:29:12 -07:00
Sverre Rabbelier bb6ad28c23 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>
2010-03-28 09:26:16 -07:00
Junio C Hamano 0476228de5 Merge branch 'jc/color-attrs' into maint
* jc/color-attrs:
  color: allow multiple attributes
2010-03-24 16:24:13 -07:00
Junio C Hamano bcbbe4f9d9 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
2010-03-24 16:24:03 -07:00
Junio C Hamano 7b676b1bb5 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
2010-03-24 16:23:50 -07:00
Markus Heidelberg 846b8f681a 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>
2010-03-24 11:31:45 -07:00
Junio C Hamano 0b3dcfe721 Git 1.7.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 17:01:22 -07:00
Junio C Hamano d16a5dafdc 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
2010-03-21 17:00:22 -07:00
Michael J Gruber 11f54989da .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>
2010-03-21 16:30:17 -07:00
Michael J Gruber 476386858c 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>
2010-03-21 14:45:05 -07:00
Michael J Gruber a3cfb7f83f 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>
2010-03-21 14:42:24 -07:00
Michael J Gruber dddfb3f126 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>
2010-03-21 14:40:18 -07:00
Michael J Gruber b6c7c41b17 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>
2010-03-21 14:40:02 -07:00
Junio C Hamano 8fe5d87622 Update draft release notes to 1.7.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20 11:29:13 -07:00
Andreas Gruenbacher 730b020030 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>
2010-03-20 09:28:48 -07:00
Andreas Gruenbacher 8da61a2ab4 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>
2010-03-20 09:27:17 -07:00
Andreas Gruenbacher aac1d7b889 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>
2010-03-20 09:25:25 -07:00
Imre Deak e9bd323510 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>
2010-03-20 08:49:31 -07:00
Jonathan Nieder c40d92e4c7 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>
2010-03-20 08:25:31 -07:00
Stephen Boyd 0d12e59f63 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>
2010-03-20 07:25:02 -07:00
Thomas Rast 7d182f52f1 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>
2010-03-17 11:07:06 -07:00
Ian Ward Comfort d23e7570a7 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>
2010-03-17 11:03:44 -07:00
Michael J Gruber 7325283987 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>
2010-03-15 15:25:17 -07:00
Michael J Gruber 71928f7f11 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>
2010-03-15 15:20:03 -07:00
Junio C Hamano b75aea8f5b tests for "git add ignored-dir/file" without -f
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13 23:23:22 -08:00
Jeff King 29209cbe58 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>
2010-03-13 23:23:08 -08:00
Junio C Hamano 0d7c2430ab 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>
2010-03-13 23:22:50 -08:00
Dave Olszewski 8fcaca3ff2 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>
2010-03-13 21:23:43 -08:00
René Scharfe 8ca7880356 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>
2010-03-13 13:18:09 -08:00
Junio C Hamano 34b383e7cd t/Makefile: remove test artifacts upon "make clean"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13 12:41:20 -08:00
René Scharfe 00fb3d214c 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>
2010-03-13 12:04:17 -08:00
Junio C Hamano 4a2284b999 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>
2010-03-11 21:40:33 -08:00
Junio C Hamano 7ff8b790bb Merge accumulated fixes to prepare for 1.7.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-08 00:50:37 -08:00
Junio C Hamano 6eb3adff9e Merge branch 'mw/maint-gcc-warns-unused-write' into maint
* mw/maint-gcc-warns-unused-write:
  run-command.c: fix build warnings on Ubuntu
2010-03-08 00:36:02 -08:00
Junio C Hamano 990169b9b1 Merge branch 'fn/maint-mkdtemp-compat' into maint
* fn/maint-mkdtemp-compat:
  Fix gitmkdtemp: correct test for mktemp() return value
2010-03-08 00:36:02 -08:00
Junio C Hamano bd08ecc487 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
2010-03-08 00:36:02 -08:00
Junio C Hamano 030bc0aa8b Merge branch 'as/maint-expire' into maint
* as/maint-expire:
  reflog: honor gc.reflogexpire=never
  prune: honor --expire=never
2010-03-08 00:36:01 -08:00
Junio C Hamano 193c7aaf5f 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
2010-03-08 00:36:01 -08:00
Junio C Hamano 57c118c268 Merge branch 'jk/maint-push-tracking-wo-remote' into maint
* jk/maint-push-tracking-wo-remote:
  push: fix segfault for odd config
2010-03-08 00:36:01 -08:00
Junio C Hamano 2dd96ea21f 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
2010-03-08 00:36:00 -08:00
Junio C Hamano 162b4643b6 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.
2010-03-08 00:36:00 -08:00
Junio C Hamano 919451330b Merge branch 'jk/maint-add--interactive-delete' into maint
* jk/maint-add--interactive-delete:
  add-interactive: fix bogus diff header line ordering
2010-03-08 00:36:00 -08:00
Junio C Hamano 493e433277 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.
2010-03-08 00:36:00 -08:00
Junio C Hamano 6ae611fa8d 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
2010-03-08 00:35:59 -08:00
Junio C Hamano 1f54d693fd 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
2010-03-08 00:35:59 -08:00