Commit graph

20619 commits

Author SHA1 Message Date
Junio C Hamano b7380fa7a9 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
2010-03-07 14:53:53 -08:00
Junio C Hamano cb16bcc369 Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6
* jk/maint-rmdir-fix:
  rm: fix bug in recursive subdirectory removal
2010-03-07 14:53:50 -08:00
Junio C Hamano 11a1a49a16 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()
2010-03-07 14:53:45 -08:00
Junio C Hamano 7b576f9910 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
2010-03-07 14:53:40 -08:00
Junio C Hamano 7f43e75adc Merge branch 'cc/maint-bisect-paths' into maint-1.6.6
* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters
2010-03-07 14:53:35 -08:00
Junio C Hamano e8a285e553 Merge branch 'maint-1.6.5' into maint-1.6.6
* maint-1.6.5:
  Remove extra '-' from git-am(1)
2010-03-04 22:24:19 -08:00
Michal Sojka 8024d5961b Remove extra '-' from git-am(1)
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-04 22:02:44 -08:00
Christian Couder 8f69f72fca bisect: error out when passing bad path parameters
As reported by Mark Lodato, "git bisect", when it was started with
path parameters that match no commit was kind of working without
taking account of path parameters and was reporting something like:

Bisecting: -1 revisions left to test after this (roughly 0 steps)

It is more correct and safer to just error out in this case, before
displaying the revisions left, so this patch does just that.

Note that this bug is very old, it exists at least since v1.5.5.
And it is possible to detect that case earlier in the bisect
algorithm, but it is not clear that it would be an improvement to
error out earlier, on the contrary it may change the behavior of
"git rev-list --bisect-all" for example, which is currently correct.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-01 01:04:35 -08:00
Johannes Sixt 97a449ee30 t3301-notes: insert a shbang line in ./fake_editor.sh
This is required on Windows because git-notes is now a built-in
rather than a shell script.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-25 12:20:16 -08:00
Thomas Rast 36c079756f cherry_pick_list: quit early if one side is empty
The --cherry-pick logic starts by counting the commits on each side,
so that it can filter away commits on the bigger one.  However, so
far it missed an opportunity for optimization: it doesn't need to do
any work if either side is empty.

This in particular helps the common use-case 'git rebase -i HEAD~$n':
it internally uses --cherry-pick, but since HEAD~$n is a direct
ancestor the left side is always empty.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-20 10:33:11 -08:00
René Scharfe 462749b728 utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
is_utf8() works by calling utf8_width() for each character at the
supplied location.  In strbuf_add_wrapped_text(), we do that anyway
while wrapping the lines.  So instead of checking the encoding
beforehand, optimistically assume that it's utf-8 and wrap along
until an invalid character is hit, and when that happens start over.

This pays off if the text consists only of valid utf-8 characters.
The following command was run against the Linux kernel repo with
git 1.7.0:

	$ time git log --format='%b' v2.6.32 >/dev/null

	real	0m2.679s
	user	0m2.580s
	sys	0m0.100s

	$ time git log --format='%w(60,4,8)%b' >/dev/null

	real	0m4.342s
	user	0m4.230s
	sys	0m0.110s

And with this patch series:

	$ time git log --format='%w(60,4,8)%b' >/dev/null

	real	0m3.741s
	user	0m3.630s
	sys	0m0.110s

So the cost of wrapping is reduced to 70% in this case.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-20 09:22:44 -08:00
René Scharfe 68ad5e1e9c utf8.c: remove strbuf_write()
The patch before the previous one made sure that all callers of
strbuf_add_wrapped_text() supply a strbuf.  Replace all calls of
strbuf_write() with regular strbuf functions and remove it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-20 09:19:35 -08:00
René Scharfe 3c0ff44a1e utf8.c: remove print_spaces()
The previous patch made sure that strbuf_add_wrapped_text() (and thus
strbuf_add_indented_text(), too) always get a strbuf.  Make use of
this fact by adding strbuf_addchars(), a small helper that adds a
char the specified number of times to a strbuf, and use it to replace
print_spaces().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-20 09:19:06 -08:00
René Scharfe bb96a2c900 utf8.c: remove print_wrapped_text()
strbuf_add_wrapped_text() is called only from print_wrapped_text()
without a strbuf (in which case it writes its results to stdout).

At its only callsite, supply a strbuf, call strbuf_add_wrapped_text()
directly and remove the wrapper function.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-20 09:18:04 -08:00
Jeff King 3fc0d131c5 rm: fix bug in recursive subdirectory removal
If we remove a path in a/deep/subdirectory, we should try to
remove as many trailing components as possible (i.e.,
subdirectory, then deep, then a). However, the test for the
return value of rmdir was reversed, so we only ever deleted
at most one level.

The fix is in remove_path, so "apply" and "merge-recursive"
also are fixed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-18 22:22:22 -08:00
Gabriel Filion ab62677b14 require_work_tree broken with NONGIT_OK
With NONGIT_OK set, require_work_tree function outside a git repository
gives a syntax error.  This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.

Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 10:55:12 -08:00
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