Commit graph

20603 commits

Author SHA1 Message Date
Junio C Hamano eb0bcd0fbe Merge branch 'maint-1.6.5' into maint-1.6.6
* maint-1.6.5:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
2010-02-16 15:04:55 -08:00
Jeff King 003c6abdb2 dwim_ref: fix dangling symref warning
If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-16 09:03:58 -08:00
Thomas Rast 460ccd0e19 stash pop: remove 'apply' options during 'drop' invocation
The 'git stash pop' option parsing used to remove the first argument
in --index mode.  At the time this was implemented, this first
argument was always --index.  However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

  git stash drop --index

by running

  git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way.  This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:27 -08:00
Larry D'Anna 8324b977ae diff: make sure --output=/bad/path is caught
The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:01 -08:00
Pete Harlan 7283bbc70a Remove hyphen from "git-command" in two error messages
Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 18:20:54 -08:00
René Scharfe ef0065034a fix minor memory leak in get_tree_entry()
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 03:04:20 -08:00
Junio C Hamano 341d9a48cc Fix typo in 1.6.6.2 release notes
Of course, these are changes since 1.6.6.1; changes since 1.6.6.2
would have been nil.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:40:01 -08:00
Junio C Hamano 8222153d84 Re-fix check-ref-format documentation mark-up
It is not double-backslash we forbid; backslashes are forbidden since
a4c2e699 (Disallow '\' in ref names, 2009-05-08)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:39:03 -08:00
Jacob Helwig 5da8171370 filter-branch: Fix error message for --prune-empty --commit-filter
Running filter-branch with --prune-empty and --commit-filter reports:

  "Cannot set --prune-empty and --filter-commit at the same time".

Change it to use the correct option name: --commit-filter

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:12:36 -08:00
Junio C Hamano 4133fd2552 Git 1.6.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:44:11 -08:00
Junio C Hamano 216d2e0f3f Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  t8003: check exit code of command and error message separately
2010-02-10 13:42:48 -08:00
Junio C Hamano 33f0ea42e1 t8003: check exit code of command and error message separately
Shell reports exit status only from the most downstream command
in a pipeline.  In these tests, we want to make sure that the
command fails in a controlled way, and produces a correct error
message.

This issue was known by Jay who submitted the patch, and also was
pointed out by Hannes during the review process, but I forgot to
fix it up before applying.  Sorry about that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:42:29 -08:00
Junio C Hamano 57ffc0e775 Merge branch 'sp/maint-fast-import-large-blob' into maint
* sp/maint-fast-import-large-blob:
  fast-import: Stream very large blobs directly to pack
2010-02-10 13:32:20 -08:00
Junio C Hamano 800d1fb0ab Merge branch 'gp/maint-cvsserver' into maint
* gp/maint-cvsserver:
  git-cvsserver: allow regex metacharacters in CVSROOT
2010-02-10 13:02:52 -08:00
Junio C Hamano 410e99fadf Merge branch 'jc/maint-reflog-bad-timestamp' into maint
* jc/maint-reflog-bad-timestamp:
  t0101: use a fixed timestamp when searching in the reflog
  Update @{bogus.timestamp} fix not to die()
  approxidate_careful() reports errorneous date string
2010-02-10 13:02:43 -08:00
Junio C Hamano c329898abb Merge branch 'il/maint-xmallocz' into maint
* il/maint-xmallocz:
  Fix integer overflow in unpack_compressed_entry()
  Fix integer overflow in unpack_sha1_rest()
  Fix integer overflow in patch_delta()
  Add xmallocz()
2010-02-10 13:02:16 -08:00
Junio C Hamano b0e67fffb4 Merge branch 'jh/maint-config-file-prefix' into maint
* jh/maint-config-file-prefix:
  builtin-config: Fix crash when using "-f <relative path>" from non-root dir
2010-02-10 13:02:05 -08:00
Junio C Hamano 2e9d7330aa Merge branch 'nd/include-termios-for-osol' into maint
* nd/include-termios-for-osol:
  Add missing #include to support TIOCGWINSZ on Solaris
2010-02-10 13:01:55 -08:00
Junio C Hamano a42332c217 Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maint
* jc/maint-1.6.1-checkout-m-custom-merge:
  checkout -m path: fix recreating conflicts

Conflicts:
	t/t7201-co.sh
2010-02-10 12:54:15 -08:00
Junio C Hamano c6eba1d5b2 Merge branch 'rs/maint-archive-match-pathspec' into maint
* rs/maint-archive-match-pathspec:
  archive: complain about path specs that don't match anything
2010-02-10 12:52:39 -08:00
Junio C Hamano 8ff883029a check-ref-format documentation: fix enumeration mark-up
The last item in the enumerated refname rule was mistakenly made into
a sub-item of the 7th one.  It should be the 8th one in the list on its
own.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 10:19:13 -08:00
Junio C Hamano e33cc592de Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  blame: prevent a segv when -L given start > EOF
2010-02-08 21:53:54 -08:00
Jay Soffian 92f9e273e8 blame: prevent a segv when -L given start > EOF
blame would segv if given -L <lineno> with <lineno> past the end of the file.
While we're fixing the bug, add test cases for an invalid <start> when called
as -L <start>,<end> or -L<start>.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 21:52:44 -08:00
Junio C Hamano a598331f95 Merge branch 'jc/maint-push-doc-status' into maint
* jc/maint-push-doc-status:
  git-push: document all the status flags used in the output
2010-02-08 16:49:22 -08:00
Junio C Hamano b7047abc12 git-push: document all the status flags used in the output
We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 16:49:00 -08:00
Junio C Hamano 0c15da68e8 Merge branch 'jc/maint-imap-config-parse' into maint
* jc/maint-imap-config-parse:
  Fix parsing of imap.preformattedHTML and imap.sslverify
2010-02-08 15:09:19 -08:00
Junio C Hamano ace706e2a6 Fix parsing of imap.preformattedHTML and imap.sslverify
These two variables are boolean and can lack "= value" in the
configuration file.  Do not reject such input early in the
parser callback function.

Also the key are downcased before being given to the callback,
so we should run strcmp() with keyword spelled in all-lowercase.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 15:08:31 -08:00
Junio C Hamano 35da43e9bb Merge branch 'jc/maint-doc-git-add-example' into maint
* jc/maint-doc-git-add-example:
  git-add documentation: Fix shell quoting example
2010-02-08 12:13:56 -08:00
Junio C Hamano bf7cbb2f04 git-add documentation: Fix shell quoting example
When 921177f (Documentation: improve "add", "pull" and "format-patch"
examples, 2008-05-07) converted this from enumeration header to displayed
text, it failed to adjust for the AsciiDoc's rule to quote backslashes.
In displayed text, backslash is shown verbatim, while in enumeration
header, we need to double it.

We have a similar construct in git-rm.txt documentation, and need to be
careful when somebody wants to update it to match the style of the "git
add" example.

Noticed by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 12:12:41 -08:00
René Scharfe fe12d8e84f archive: simplify archive format guessing
The code to guess an output archive's format consumed any --format
options and built a new one.  Jonathan noticed that it does so in an
unsafe way, risking to overflow the static buffer fmt_opt.

Change the code to keep the existing --format options intact and to only
add a new one if a format could be guessed based on the output file name.
The new option is added as the first one, allowing the existing ones to
overrule it, i.e. explicit --format options given on the command line win
over format guesses, as before.

To simplify the code further, format_from_name() is changed to return the
full --format option, thus no potentially dangerous sprintf() calls are
needed any more.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-07 15:40:27 -08:00
Wesley J. Landaker 2b26e0e189 Update git fsck --full short description to mention packs
The '--full' option to git fsck does two things:

  1) Check objects in packs
  2) Check alternate objects

This is documented in the git fsck manual; this patch reflects that in
the short git fsck option help message as well.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05 13:01:45 -08:00
Junio C Hamano b401a12a2c Merge branch 'jc/maint-limit-note-output' into maint
* jc/maint-limit-note-output:
  Fix "log --oneline" not to show notes
  Fix "log" family not to be too agressive about showing notes
2010-02-05 10:59:05 -08:00
Shawn O. Pearce 5eef828bc0 fast-import: Stream very large blobs directly to pack
If a blob is larger than the configured big-file-threshold, instead
of reading it into a single buffer obtained from malloc, stream it
onto the end of the current pack file.  Streaming the larger objects
into the pack avoids the 4+ GiB memory footprint that occurs when
fast-import is processing 2+ GiB blobs.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-01 12:09:47 -08:00
Junio C Hamano 153559a964 Merge branch 'sb/maint-octopus' into maint-1.6.5
* sb/maint-octopus:
  octopus: remove dead code
  octopus: reenable fast-forward merges
  octopus: make merge process simpler to follow
2010-02-01 00:06:11 -08:00
Junio C Hamano 4b683658be Merge branch 'bg/maint-add-all-doc' into maint-1.6.5
* bg/maint-add-all-doc:
  git-rm doc: Describe how to sync index & work tree
  git-add/rm doc: Consistently back-quote
  Documentation: 'git add -A' can remove files
2010-02-01 00:04:12 -08:00
Junio C Hamano 3325cea0f7 Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  fix memcpy of overlapping area
2010-01-29 23:36:13 -08:00
Jeff King 65d41d48a4 fix memcpy of overlapping area
Caught by valgrind in t5500, but it is pretty obvious from
reading the code that this is shifting elements of an array
to the left, which needs memmove.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-29 09:52:21 -08:00
SZEDER Gábor 63d04a7804 bash: don't offer remote transport helpers as subcommands
Since commits a2d725b7 (Use an external program to implement fetching
with curl, 2009-08-05) and c9e388bb (Make the
"traditionally-supported" URLs a special case, 2009-09-03) remote
transport helpers like 'remote-ftp' and 'remote-curl' are offered by the
completion script as available subcommands.  Not good, since they are
helpers, therefore should not be offered, so filter them out.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-28 12:36:12 -08:00
Junio C Hamano 6c647af306 t0101: use a fixed timestamp when searching in the reflog
That will give us a better reproducibility during tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-27 10:54:30 -08:00
Junio C Hamano a5e10acbb9 Update @{bogus.timestamp} fix not to die()
The caller will say "It is not a valid object name" if it wants to, and
some callers may even try to see if it names an object and otherwise try to
see if it is a path.

Pointed out by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-27 10:53:09 -08:00
Junio C Hamano 93cfa7c7a8 approxidate_careful() reports errorneous date string
For a long time, the time based reflog syntax (e.g. master@{yesterday})
didn't complain when the "human readable" timestamp was misspelled, as
the underlying mechanism tried to be as lenient as possible.  The funny
thing was that parsing of "@{now}" even relied on the fact that anything
not recognized by the machinery returned the current timestamp.

Introduce approxidate_careful() that takes an optional pointer to an
integer, that gets assigned 1 when the input does not make sense as a
timestamp.

As I am too lazy to fix all the callers that use approxidate(), most of
the callers do not take advantage of the error checking, but convert the
code to parse reflog to use it as a demonstration.

Tests are mostly from Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 13:51:41 -08:00
Ilari Liusvaara 4ab07e4d10 Fix integer overflow in unpack_compressed_entry()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 13:00:16 -08:00
Ilari Liusvaara 3aee68aa68 Fix integer overflow in unpack_sha1_rest()
[jc: later NUL termination by the caller becomes unnecessary]

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 13:00:10 -08:00
Ilari Liusvaara 222083a158 Fix integer overflow in patch_delta()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 12:57:59 -08:00
Ilari Liusvaara 5bf9219d01 Add xmallocz()
Add routine for allocating NUL-terminated memory block without risking
integer overflow in addition of +1 for NUL byte.

[jc: with suggestion from Bill Lear]

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 12:57:53 -08:00
Gerrit Pape f9acaeae88 git-cvsserver: allow regex metacharacters in CVSROOT
When run in a repository with a path name containing regex metacharacters
(e.g. +), git-cvsserver failed to split the client request into CVSROOT
and module.  Now metacharacters are disabled for the value of CVSROOT in
the perl regex so that directory names containing metacharacters are
handled properly.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 12:54:18 -08:00
Johan Herland 65807ee697 builtin-config: Fix crash when using "-f <relative path>" from non-root dir
When your current directory is not at the root of the working tree, and you
use the "-f" option with a relative path, the current code tries to read
from a wrong file, since argv[2] is now beyond the end of the rearranged
argument list.

This patch replaces the incorrect argv[2] with the variable holding the
given config file name.

The bug was introduced by d64ec16 (git config: reorganize to use parseopt).

[jc: added test]

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-26 11:20:06 -08:00
Junio C Hamano b30ccd7573 Merge branch 'maint' of git://git.spearce.org/git-gui into maint
* 'maint' of git://git.spearce.org/git-gui:
  git-gui: work from the .git dir
  git-gui: Fix applying a line when all following lines are deletions
  git-gui: Correct file_states when unstaging partly staged entry
  git-gui: Fix gitk for branch whose name matches local file
  git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
  git-gui: handle really long error messages in updateindex.
  git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
  git-gui: Makefile: consolidate .FORCE-* targets
2010-01-24 11:16:26 -08:00
Giuseppe Bilotta 87cd09f43e git-gui: work from the .git dir
When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:04 -08:00
Jeff Epler 390425bdef git-gui: Fix applying a line when all following lines are deletions
If a diff looked like:

 @@
  context
 -del1
 -del2

and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:00:09 -08:00