Commit graph

19376 commits

Author SHA1 Message Date
Junio C Hamano 814035c12a Merge branch 'maint-1.6.3' into maint-1.6.4
* maint-1.6.3:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails

Conflicts:
	builtin-commit.c
2010-01-18 21:37:06 -08:00
Junio C Hamano 011c181cc6 Merge branch 'maint-1.6.2' into maint-1.6.3
* maint-1.6.2:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails

Conflicts:
	diff.c
2010-01-18 21:29:47 -08:00
Junio C Hamano 18d97f5fed Merge commit 'v1.6.4.4-8-g8de6518' into maint-1.6.4
* commit 'v1.6.4.4-8-g8de6518':
  Fix mis-backport of t7002
2010-01-18 21:18:41 -08:00
Junio C Hamano 8de65185e8 Fix mis-backport of t7002
The original patch that became cfe370c (grep: do not segfault when -f is
used, 2009-10-16), was made against "maint" or newer branch back then, but
the fix addressed the issue that was present as far as in 1.6.4 series.

The maintainer backported the patch to the 1.6.4 maintenance branch, but
failed to notice that the new tests assumed the setup done by the script
in "maint", which did quite a lot more than the same test script in 1.6.4
series, and the output didn't match the expected result.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18 21:14:49 -08:00
Junio C Hamano c5034673fd Merge branch 'maint-1.6.1' into maint-1.6.2
* maint-1.6.1:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails

Conflicts:
	diff.c
2010-01-10 00:49:47 -08:00
Junio C Hamano 96aa7adda3 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
2010-01-10 00:48:47 -08:00
Andreas Gruenbacher 0606c36a73 base85: Make the code more obvious instead of explaining the non-obvious
Here is another cleanup ...

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:47 -08:00
Andreas Gruenbacher b0bec518aa base85: encode_85() does not use the decode table
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:37 -08:00
Andreas Gruenbacher 75b7e16b6e base85 debug code: Fix length byte calculation
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:27 -08:00
Junio C Hamano 64da3ae5c1 checkout -m: do not try to fall back to --merge from an unborn branch
If switching from an unborn branch (= empty tree) to a valid commit failed
without -m, it would fail with -m option as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 23:51:47 -08:00
Matthieu Moy 6e8f993a5a branch: die explicitly why when calling "git branch [-a|-r] branchname".
The -a and -r options used to be silently ignored in such a command.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-31 14:52:05 -08:00
Jeff King 70d7099916 textconv: stop leaking file descriptors
We read the output from textconv helpers over a pipe, but we
never actually closed our end of the pipe after using it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-30 01:22:27 -08:00
Junio C Hamano 799fdb4ed0 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  commit: --cleanup is a message option
  t7102: make the test fail if one of its check fails
2009-12-29 20:16:34 -08:00
Greg Price e97ca7f41f commit: --cleanup is a message option
In the usage message for "git commit", the --cleanup option appeared
at the end, as one of the "contents options":

usage: git commit [options] [--] <filepattern>...
...
Commit message options
...
Commit contents options
...
    --allow-empty         ok to record an empty change
    --cleanup <default>   how to strip spaces and #comments from message

This is confusing, in part because it makes it ambiguous whether
--allow-empty, just above, refers to an empty diff or an empty message.

Move --cleanup into the 'message options' group.  Also add a pair of
comments to prevent similar oversights in the future.

Signed-off-by: Greg Price <price@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-29 20:15:41 -08:00
Andreas Schwab c985ddf318 git count-objects: handle packs bigger than 4G
Use off_t to count sizes of packs and objects to avoid overflow after
4Gb.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-29 19:51:37 -08:00
Nguyễn Thái Ngọc Duy 153bb839aa t7102: make the test fail if one of its check fails
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-29 19:39:27 -08:00
Jan Krüger f1be316ada rebase -i: more graceful handling of invalid commands
Currently, when there is an invalid command, the rest of the line is
still treated as if the command had been valid, i.e. rebase -i attempts
to produce a patch, using the next argument as a SHA1 name. If there is
no next argument or an invalid one, very confusing error messages
appear (the line was '.'; path to git-rebase-todo substituted):

Unknown command: .
fatal: ambiguous argument 'Please fix this in the file $somefile.':
unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
fatal: Not a valid object name Please fix this in the file $somefile.
fatal: bad revision 'Please fix this in the file $somefile.'

Instead, verify the validity of the remaining line and error out earlier
if necessary.

Signed-off-by: Jan Krüger <jk@jk.gs>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-27 23:12:44 -07:00
Gerrit Pape a29aa47da7 help -i: properly error out if no info viewer can be found
With this commit, git help -i <cmd> prints an error message and exits
non-zero instead of being silent and exit code 0.

Reported by Trent W. Buck through
 http://bugs.debian.org/537664

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-27 23:05:24 -07:00
Junio C Hamano caa7dac163 Merge branch 'jk/maint-1.6.3-ls-files-no-ignore-cached' into maint-1.6.4
* jk/maint-1.6.3-ls-files-no-ignore-cached:
  ls-files: excludes should not impact tracked files
2009-10-25 15:34:27 -07:00
Junio C Hamano 1c92a08f28 Merge branch 'jn/maint-1.6.3-check-ref-format-doc' into maint-1.6.4
* jn/maint-1.6.3-check-ref-format-doc:
  Documentation: describe check-ref-format --branch
2009-10-25 15:34:21 -07:00
Matt Kraai cfe370c647 grep: do not segfault when -f is used
"git grep" would segfault if its -f option was used because it would
try to use an uninitialized strbuf, so initialize the strbuf.

Thanks to Johannes Sixt <j.sixt@viscovery.net> for the help with the
test cases.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-16 23:47:47 -07:00
Jonathan Nieder 604e0cb5cb Documentation: describe check-ref-format --branch
Unless one already knew, it was not obvious what sort of shorthand
"git check-ref-format --branch" expands.  Explain it.

The --branch argument is not optional.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-12 16:28:42 -07:00
Miklos Vajna 0a0c342568 git-stash documentation: mention default options for 'list'
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-12 16:16:36 -07:00
Jeff King b5227d80ae ls-files: excludes should not impact tracked files
In all parts of git, .gitignore and other exclude files
impact only how we treat untracked files; they should have
no effect on files listed in the index.

This behavior was originally implemented very early on in
9ff768e, but only for --exclude-from. Later, commit 63d285c
accidentally caused us to trigger the behavior for
--exclude-per-directory.

This patch totally ignores excludes for files found in the
index. This means we are reversing the original intent of
9ff768e, while at the same time fixing the accidental
behavior of 63d285c. This is a good thing, though, as the
way that 9ff768e behaved does not really make sense with the
way exclusions are used in modern git.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-12 16:12:49 -07:00
Ben Walton ac78b00939 ls-files: die instead of fprintf/exit in -i error
When ls-files was called with -i but no exclude pattern, it was
calling fprintf(stderr, "...", NULL) and then exiting.  On Solaris,
passing NULL into fprintf was causing a segfault.  On glibc systems,
it was simply producing incorrect output (eg: "(null)": ...).  The
NULL pointer was a result of argv[0] not being preserved by the option
parser.  Instead of requesting that the option parser preserve
argv[0], use die() with a constant string.

A trigger for this bug was: `git ls-files -i`

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-08 22:54:34 -07:00
Junio C Hamano 1cd749cc07 fast-import.c::validate_raw_date(): really validate the value
When reading the "raw format" timestamp from the input stream, make sure
that the timezone offset is a reasonable value by imitating 7122f82
(date.c: improve guess between timezone offset and year., 2006-06-08).

We _might_ want to also check if the timestamp itself is reasonable, but
that is left for a separate commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-07 13:05:03 -07:00
Junio C Hamano 04ce83e2b9 Merge branch 'jc/maint-1.6.4-show-branch-default' into maint
* jc/maint-1.6.4-show-branch-default:
  show-branch: fix segfault when showbranch.default exists
2009-10-04 14:48:44 -07:00
Junio C Hamano 3af1cae469 show-branch: fix segfault when showbranch.default exists
When running "git show-branch" without any parameter in a repository that
has showbranch.default defined, we used to rely on the fact that our
handcrafted option parsing loop never looked at av[0].

The array of default strings had the first real command line argument in
default_arg[0], but the option parser wanted to look at the array starting
at av[1], so we assigned the address of -1th element to av to force the
loop start working from default_arg[0].

This no longer worked since 5734365 (show-branch: migrate to parse-options
API, 2009-05-21), as parse_options_start() saved the incoming &av[0] in
its ctx->out and later in parse_options_end() it did memmove to ctx->out
(with ctx->cpidx == 0), overwriting the memory before default_arg[] array.

I am not sure if this is a bug in parse_options(), or a bug in the caller,
and tonight I do not have enough concentration to figure out which.  In
any case, this patch works the issue around.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-04 14:44:34 -07:00
Matthieu Moy bb8cccd017 push: Correctly initialize nonfastforward in transport_push.
The variable is assigned unconditionally in print_push_status, but
print_push_status is not reached by all codepaths. In particular, this
fixes a bug where "git push ... nonexisting-branch" was complaining about
non-fast forward.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-20 12:11:29 -07:00
Junio C Hamano cb572206d9 GIT 1.6.4.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-16 14:53:26 -07:00
Junio C Hamano af4f640529 Merge branch 'jc/maint-unpack-objects-strict' into maint
* jc/maint-unpack-objects-strict:
  Fix "unpack-objects --strict"

Conflicts:
	builtin-unpack-objects.c
2009-09-16 14:45:18 -07:00
Junio C Hamano 6674d310d1 Merge branch 'tf/diff-whitespace-incomplete-line' into maint
* tf/diff-whitespace-incomplete-line:
  xutils: Fix xdl_recmatch() on incomplete lines
  xutils: Fix hashing an incomplete line with whitespaces at the end
2009-09-16 14:27:08 -07:00
Junio C Hamano bd91890c62 Merge branch 'jk/maint-1.6.3-checkout-unborn' into maint
* jk/maint-1.6.3-checkout-unborn:
  checkout: do not imply "-f" on unborn branches
2009-09-16 14:26:56 -07:00
Junio C Hamano bba287531b Merge branch 'jc/maint-checkout-index-to-prefix' into maint
* jc/maint-checkout-index-to-prefix:
  check_path(): allow symlinked directories to checkout-index --prefix
2009-09-16 14:26:40 -07:00
Junio C Hamano 4197ce3c6d Merge branch 'rc/maint-http-no-head-pack-check' into maint
* rc/maint-http-no-head-pack-check:
  http.c: avoid freeing an uninitialized pointer
2009-09-14 14:48:20 -07:00
Junio C Hamano b2025146d0 http.c: avoid freeing an uninitialized pointer
An earlier 59b8d38 (http.c: remove verification of remote packs) left
the variable "url" uninitialized; "goto cleanup" codepath can free it
which is not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 14:48:15 -07:00
Junio C Hamano 7fb6bcff2d GIT 1.6.4.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:28:13 -07:00
Mark Lodato d3d7d47e6e svn: properly escape arguments for authors-prog
Previously, the call to authors-prog was not properly escaped, so any
special characters in the Subversion username, such as spaces and
semi-colons, would be interpreted by the shell rather than being passed
in as the first argument.  Now all unsafe characters are escaped using
"git rev-parse --sq-quote"

[ew: switched from "\Q..\E" to "rev-parse --sq-quote"]

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:28:07 -07:00
Junio C Hamano 45c58ba00a Merge branch 'cb/maint-1.6.3-grep-relative-up' into maint
* cb/maint-1.6.3-grep-relative-up:
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
	t/t7002-grep.sh
2009-09-13 01:24:20 -07:00
Tay Ray Chuan 59b8d38f6e http.c: remove verification of remote packs
Make http.c::fetch_pack_index() no longer check for the remote pack
with a HEAD request before fetching the corresponding pack index file.

Not only does sending a HEAD request before we do a GET incur a
performance penalty, it does not offer any significant error-
prevention advantages (pack fetching in the *_http_pack_request()
methods is capable of handling any errors on its own).

This addresses an issue raised elsewhere:

  http://code.google.com/p/msysgit/issues/detail?id=323
  http://support.github.com/discussions/repos/957-cant-clone-over-http-or-git

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 01:45:36 -07:00
Emmanuel Trillaud 90e431152e git-pull: do not mention --quiet and --verbose twice
git-pull.txt includes fetch-options.txt and merge-options.txt, both of
which document the --quiet and --verbose.

Supress the ones from fetch-options.txt.

Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-07 15:45:13 -07:00
Bert Wesarg 6d71c1dca4 githooks.txt: put hooks into subsections
All hooks are currently in its own section. Which may confuse users,
because the section name serves as the hook file name and sections are
all caps for man pages. Putting them into a new HOOKS section and each
hook into a subsection keeps the case to lower case.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-07 15:45:13 -07:00
Clemens Buchacher 493b7a08d8 grep: accept relative paths outside current working directory
"git grep" would barf at relative paths pointing outside the current
working directory (or subdirectories thereof). Use quote_path_relative(),
which can handle such cases just fine.

[jc: added tests.]

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-07 15:03:04 -07:00
Clemens Buchacher 929e37d3df grep: fix exit status if external_grep() punts
If external_grep() is called and punts, grep_cache() mistakenly reported a
hit, even if there were none.  The bug can be triggered by calling "git
grep --no-color" from a subdirectory.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-07 15:02:31 -07:00
Jeff King 14b772a0d7 push: re-flow non-fast-forward message
The extreme raggedness of the right edge make this jarring
to read. Let's re-flow the text to fill the lines in a more
even way.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-06 00:39:15 -07:00
Jeff King e1f8f0cfbe push: fix english in non-fast-forward message
We must use an article when referring to the section
because it is a non-proper noun, and it must be the definite
article because we are referring to a specific section.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-06 00:39:14 -07:00
Junio C Hamano bc29df6022 Merge branch 'maint-1.6.3' into maint
* maint-1.6.3:
  git-clone: add missing comma in --reference documentation
  git-cvsserver: no longer use deprecated 'git-subcommand' commands
  clone: disconnect transport after fetching
2009-09-03 09:42:56 -07:00
Junio C Hamano ba7e81430a Merge branch 'maint-1.6.2' into maint-1.6.3
* maint-1.6.2:
  git-clone: add missing comma in --reference documentation
  clone: disconnect transport after fetching
2009-09-03 09:42:38 -07:00
Miklos Vajna 405923761a git-clone: add missing comma in --reference documentation
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-03 09:41:56 -07:00
Gerrit Pape d2feb01aa5 git-cvsserver: no longer use deprecated 'git-subcommand' commands
git-cvsserver still references git commands like 'git-config', which
is depcrecated.  This commit changes git-cvsserver to use the
'git subcommand' form.

Sylvain Beucler reported the problem through
 http://bugs.debian.org/536067

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-02 18:41:42 -07:00