Commit graph

32319 commits

Author SHA1 Message Date
Junio C Hamano a9dc3b6481 Merge branch 'jk/empty-archive' into maint
"git archive" reports a failure when asked to create an archive out
of an empty tree.  It would be more intuitive to give an empty
archive back in such a case.

* jk/empty-archive:
  archive: handle commits with an empty tree
  test-lib: factor out $GIT_UNZIP setup
2013-04-03 09:25:15 -07:00
Junio C Hamano 9e72a56699 Merge branch 'ph/tag-force-no-warn-on-creation' into maint
"git tag -f <tag>" always said "Updated tag '<tag>'" even when
creating a new tag (i.e. not overwriting nor updating).

* ph/tag-force-no-warn-on-creation:
  tag: --force does not have to warn when creating tags
2013-04-03 09:24:51 -07:00
Junio C Hamano fa0a6a4823 Merge branch 'lf/setup-prefix-pathspec' into maint
"git cmd -- ':(top'" was not diagnosed as an invalid syntax, and
instead the parser kept reading beyond the end of the string.

* lf/setup-prefix-pathspec:
  setup.c: check that the pathspec magic ends with ")"
  setup.c: stop prefix_pathspec() from looping past the end of string
2013-04-03 09:24:19 -07:00
Junio C Hamano 92e0d91632 Sync with 1.8.1 maintenance track
* maint-1.8.1:
  Start preparing for 1.8.1.6
  git-tag(1): we tag HEAD by default
  Fix revision walk for commits with the same dates
  t2003: work around path mangling issue on Windows
  pack-refs: add fully-peeled trait
  pack-refs: write peeled entry for non-tags
  use parse_object_or_die instead of die("bad object")
  avoid segfaults on parse_object failure
  entry: fix filter lookup
  t2003: modernize style
  name-hash.c: fix endless loop with core.ignorecase=true
2013-04-03 09:18:01 -07:00
Junio C Hamano 072dda68ea Start preparing for 1.8.1.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 09:12:11 -07:00
Junio C Hamano c81e2c61b3 Merge branch 'kb/name-hash' into maint-1.8.1
* kb/name-hash:
  name-hash.c: fix endless loop with core.ignorecase=true
2013-04-03 08:44:54 -07:00
Junio C Hamano 64379806a9 Merge branch 'kk/revwalk-slop-too-many-commit-within-a-second' into maint-1.8.1
* kk/revwalk-slop-too-many-commit-within-a-second:
  Fix revision walk for commits with the same dates
2013-04-03 08:44:02 -07:00
Junio C Hamano 67ff3d27f6 Merge branch 'jk/checkout-attribute-lookup' into maint-1.8.1
* jk/checkout-attribute-lookup:
  t2003: work around path mangling issue on Windows
  entry: fix filter lookup
  t2003: modernize style
2013-04-03 08:43:40 -07:00
Junio C Hamano f1ad05f3a5 Merge branch 'jk/fully-peeled-packed-ref' into maint-1.8.1
* jk/fully-peeled-packed-ref:
  pack-refs: add fully-peeled trait
  pack-refs: write peeled entry for non-tags
  use parse_object_or_die instead of die("bad object")
  avoid segfaults on parse_object failure
2013-04-03 08:43:03 -07:00
Junio C Hamano 8f780ca9be Merge branch 'ap/maint-diff-rename-avoid-overlap' into maint-1.8.1
* ap/maint-diff-rename-avoid-overlap:
  tests: make sure rename pretty print works
  diff: prevent pprint_rename from underrunning input
  diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-03 08:37:39 -07:00
Junio C Hamano 0311e373b5 Merge branch 'yd/doc-merge-annotated-tag' into maint-1.8.1
* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-04-03 08:36:52 -07:00
Junio C Hamano 357d7f11ba Merge branch 'ap/maint-update-index-h-is-for-help' into maint-1.8.1
* ap/maint-update-index-h-is-for-help:
  update-index: allow "-h" to also display options
2013-04-03 08:36:10 -07:00
Junio C Hamano a134a60d0b Merge branch 'jc/perl-cat-blob' into maint-1.8.1
* jc/perl-cat-blob:
  Git.pm: fix cat_blob crashes on large files
2013-04-03 08:35:45 -07:00
Junio C Hamano d7df695d85 Merge branch 'ob/imap-send-ssl-verify' into maint-1.8.1
* ob/imap-send-ssl-verify:
  imap-send: support Server Name Indication (RFC4366)
2013-04-03 08:35:33 -07:00
Junio C Hamano f4254d1fb2 Merge branch 'nd/index-pack-l10n-buf-overflow' into maint-1.8.1
* nd/index-pack-l10n-buf-overflow:
  index-pack: fix buffer overflow caused by translations
2013-04-03 08:35:06 -07:00
Thomas Rast dd686cd4b1 git-tag(1): we tag HEAD by default
The <commit>|<object> argument is actually not explained anywhere
(except implicitly in the description of an unannotated tag).  Write a
little explanation, in particular to cover the default.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 08:33:56 -07:00
Junio C Hamano 40a0f842da Update draft release notes to 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 09:23:05 -07:00
Junio C Hamano b76a9e1648 Merge branch 'ap/maint-diff-rename-avoid-overlap' into maint
* ap/maint-diff-rename-avoid-overlap:
  tests: make sure rename pretty print works
  diff: prevent pprint_rename from underrunning input
  diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-01 09:19:47 -07:00
Junio C Hamano 5753e1709e Merge branch 'rr/tests-dedup-test-config' into maint
* rr/tests-dedup-test-config:
  t4018,7810,7811: remove test_config() redefinition
2013-04-01 09:19:42 -07:00
Junio C Hamano 432930bd33 Merge branch 'yd/doc-is-in-asciidoc' into maint
* yd/doc-is-in-asciidoc:
  CodingGuidelines: our documents are in AsciiDoc
2013-04-01 09:19:40 -07:00
Junio C Hamano ab24e7521c Merge branch 'yd/doc-merge-annotated-tag' into maint
* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-04-01 09:19:37 -07:00
Junio C Hamano fec274b01f Merge branch 'tb/document-status-u-tradeoff' into maint
* tb/document-status-u-tradeoff:
  status: advise to consider use of -u when read_directory takes too long
  git status: document trade-offs in choosing parameters to the -u option
2013-04-01 09:19:30 -07:00
Junio C Hamano 41e603af58 Merge branch 'da/downcase-u-in-usage' into maint
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-04-01 09:19:04 -07:00
René Scharfe 862ae6cd67 submodule summary: support --summary-limit=<n>
In addition to "--summary-limit <n>" support the form "--summary-limit=<n>",
for consistency with other parameters and commands.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 07:37:34 -07:00
Ramkumar Ramachandra a47eab03f6 send-email: use the three-arg form of open in recipients_cmd
Perlcritic does not want to see the trailing pipe in the two-args
form of open(), i.e.

	open my $fh, "$cmd \Q$file\E |";

If $cmd were a single-token command name, it would make a lot more
sense to use four-or-more-args form "open FILEHANDLE,MODE,CMD,ARGS"
to avoid shell from expanding metacharacters in $file, but we do
expect multi-word string in $to_cmd and $cc_cmd to be expanded by
the shell, so we cannot rewrite it to

	open my $fh, "-|", $cmd, $file;

for extra safety.  At least, by using this in the three-arg form:

	open my $fh, "-|", "$cmd \Q$file\E";

we can silence Perlcritic, even though we do not gain much safety by
doing so.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 21:30:27 -07:00
Ramkumar Ramachandra 9b39703920 send-email: drop misleading function prototype
The subroutine check_file_rev_conflict() is called from two places,
both of which expects to pass a single scalar variable and see if
that can be interpreted as a pathname or a revision name.  It is
defined with a function prototype ($) to force a scalar context
while evaluating the arguments at the calling site but it does not
help the current calling sites.  The only effect it has is to hurt
future calling sites that may want to build an argument list in an
array variable and call it as check_file_rev_confict(@args).

Drop the misleading prototype, as Perlcritic suggests.

While at it, rename the function to avoid new call sites unaware of
this change arising and add a comment clarifying what this function
is for.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 21:30:27 -07:00
Ramkumar Ramachandra 622bc93091 send-email: use "return;" not "return undef;" on error codepaths
All the callers of "ask", "extract_valid_address", and "validate_patch"
subroutines assign the return values from them to a single scalar:

	$var = subr(...);

and "return undef;" in these subroutine can safely be turned into a
simpler "return;".  Doing so will also future-proof a new caller that
mistakenly does this:

    @foo = ask(...);
    if (@foo) { ... we got an answer ... } else { ... we did not ... }

Note that we leave "return undef;" in validate_address on purpose,
even though Perlcritic may complain.  The primary "return" site of
the function returns whatever is in the scalar variable $address, so
it is pointless to change only the other "return undef;" to "return".
The caller must be prepared to see an array with a single undef as
the return value from this subroutine anyway.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 21:30:09 -07:00
Ramsay Jones 803a777942 cat-file: Fix an gcc -Wuninitialized warning
After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning
hacks", 21-03-2013) removed a gcc specific hack, older versions of
gcc now issue an "'contents' might be used uninitialized" warning.
In order to suppress the warning, we simply initialize the variable
to NULL in it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29 23:47:00 -07:00
Ramsay Jones 0a34594c83 fast-import: Fix an gcc -Wuninitialized warning
Commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks",
21-03-2013) removed a gcc hack that suppressed an "might be used
uninitialized" warning issued by older versions of gcc.

However, commit 3aa99df8 ('fast-import: clarify "inline" logic in
file_change_m', 21-03-2013) addresses an (almost) identical issue
(with very similar code), but includes additional code in it's
resolution. The solution used by this commit, unlike that used by
commit cbfd5e1c, also suppresses the -Wuninitialized warning on
older versions of gcc.

In order to suppress the warning (against the 'oe' symbol) in the
note_change_n() function, we adopt the same solution used by commit
3aa99df8.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29 23:46:55 -07:00
Jeff King efa5f82540 t: check that a pattern without trailing slash matches a directory
Prior to v1.8.1.1, with:

  git init
  echo content >foo &&
  mkdir subdir &&
  echo content >subdir/bar &&
  echo "subdir export-ignore" >.gitattributes
  git add . &&
  git commit -m one &&
  git archive HEAD | tar tf -

the resulting archive would contain only "foo" and ".gitattributes",
not subdir.  This was broken with a recent change that intended to
allow "subdir/ export-ignore" to also exclude the directory, but
instead ended up _requiring_ the trailing slash by mistake.

A pattern "subdir" should match any path "subdir", whether it is a
directory or a non-directory.  A pattern "subdir/" insists that a
path "subdir" must be a directory for it to match.

This patch adds test not just for this simple case, but also for
deeper cross-directory cases, as well as cases with wildcards.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 21:48:27 -07:00
Jeff King ab3aebc15c dir.c::match_pathname(): pay attention to the length of string parameters
This function takes two counted strings: a <pattern, patternlen> pair
and a <pathname, pathlen> pair. But we end up feeding the result to
fnmatch, which expects NUL-terminated strings.

We can fix this by calling the fnmatch_icase_mem function, which
handles re-allocating into a NUL-terminated string if necessary.

While we're at it, we can avoid even calling fnmatch in some cases. In
addition to patternlen, we get "prefix", the size of the pattern that
contains no wildcard characters. We do a straight match of the prefix
part first, and then use fnmatch to cover the rest. But if there are
no wildcards in the pattern at all, we do not even need to call
fnmatch; we would simply be comparing two empty strings.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 21:48:18 -07:00
Jeff King 982ac87316 dir.c::match_pathname(): adjust patternlen when shifting pattern
If we receive a pattern that starts with "/", we shift it
forward to avoid looking at the "/" part. Since the prefix
and patternlen parameters are counts of what is in the
pattern, we must decrement them as we increment the pointer.

We remembered to handle prefix, but not patternlen. This
didn't cause any bugs, though, because the patternlen
parameter is not actually used. Since it will be used in
future patches, let's correct this oversight.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 21:48:18 -07:00
Junio C Hamano 0b6e56dfe6 dir.c::match_basename(): pay attention to the length of string parameters
The function takes two counted strings (<basename, basenamelen> and
<pattern, patternlen>) as parameters, together with prefix (the
length of the prefix in pattern that is to be matched literally
without globbing against the basename) and EXC_* flags that tells it
how to match the pattern against the basename.

However, it did not pay attention to the length of these counted
strings.  Update them to do the following:

 * When the entire pattern is to be matched literally, the pattern
   matches the basename only when the lengths of them are the same,
   and they match up to that length.

 * When the pattern is "*" followed by a string to be matched
   literally, make sure that the basenamelen is equal or longer than
   the "literal" part of the pattern, and the tail of the basename
   string matches that literal part.

 * Otherwise, use the new fnmatch_icase_mem helper to make
   sure we only lookmake sure we use only look at the
   counted part of the strings.  Because these counted strings are
   full strings most of the time, we check for termination
   to avoid unnecessary allocation.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 21:48:12 -07:00
Junio C Hamano dc09e9ec43 attr.c::path_matches(): special case paths that end with a slash
The function is given a string that ends with a slash to signal that
the path is a directory to make sure that a pattern that ends with a
slash (i.e. MUSTBEDIR) can tell directories and non-directories
apart.  However, the pattern itself (pat->pattern and
pat->patternlen) that came from such a MUSTBEDIR pattern is
represented as a string that ends with a slash, but patternlen does
not count that trailing slash. A MUSTBEDIR pattern "element/" is
represented as a counted string <"element/", 7> and this must match
match pathname "element/".

Because match_basename() and match_pathname() want to see pathname
"element" to match against the pattern <"element/", 7>, reduce the
length of the path to exclude the trailing slash when calling
these functions.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 21:47:06 -07:00
Junio C Hamano 5e950c2199 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  git help config: s/insn/instruction/
2013-03-28 14:34:07 -07:00
Junio C Hamano c68c408a7a t5516: test interaction between pushURL and pushInsteadOf correctly
1c2eafb89b (Add url.<base>.pushInsteadOf: URL rewriting for push
only, 2009-09-07) wants to make sure that a push destination read
from URL is not rewritten by pushInsteadOf because an explicit
pushURL exists; for that, a pushInsteadOf rewrite rule for the value
of remote.r.URL is set to a non-existent is set up.

We would also want to make sure that pushInsteadOf rewrite rule is
not applied to the location read from pushURL.

This way, we will make sure that

 - "testrepo/" (pushURL) gets updated;

 - the push does not try to update "trash2/" (the result of applying
   pushInsteadOf to pushURL);

 - the push does not try to update "trash3/" (the result of applying
   pushInsteadOf to URL).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 13:53:27 -07:00
Matthias Krüger 3322ad4284 git help config: s/insn/instruction/
"insn" appears to be an in-code abbreviation and should not appear
in manual/help pages.

Signed-off-by: Matthias Krüger <matthias.krueger@famsik.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 08:53:47 -07:00
Junio C Hamano 9a82efd0d2 More fixes for 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 10:57:57 -07:00
Junio C Hamano d011ab4312 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  merge-tree: fix typo in merge-tree.c::unresolved
  git-commit doc: describe use of multiple `-m` options
  git-pull doc: fix grammo ("conflicts" is plural)
2013-03-27 10:51:10 -07:00
John Keeping 187c00c6c5 merge-tree: fix typo in merge-tree.c::unresolved
When calculating whether there is a d/f conflict, the calculation of
whether both sides are directories generates an incorrect references
mask because it does not use the loop index to set the correct bit.
Fix this typo.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 10:00:50 -07:00
Christian Helmuth 6bf6366cc6 git-commit doc: describe use of multiple -m options
The text is copied from Documentation/git-tag.txt.

Signed-off-by: Christian Helmuth <christian.helmuth@genode-labs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 09:32:02 -07:00
Mihai Capotă 38ef8a76e7 git-pull doc: fix grammo ("conflicts" is plural)
Signed-off-by: Mihai Capotă <mihai@mihaic.ro>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 09:30:54 -07:00
Junio C Hamano 3bbbf18d71 More corrections for 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-26 13:14:20 -07:00
Junio C Hamano f4ccd9f1bd Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  Correct the docs about GIT_SSH.
2013-03-26 13:14:11 -07:00
Junio C Hamano 50734ea0af Merge branch 'we/submodule-update-prefix-output' into maint
"git submodule update", when recursed into sub-submodules, did not
acccumulate the prefix paths.

* we/submodule-update-prefix-output:
  submodule update: when using recursion, show full path
2013-03-26 12:44:27 -07:00
Junio C Hamano ece12fd844 Merge branch 'jk/mailsplit-maildir-muttsort' into maint
Sort filenames read from the maildir/ in a way that is more likely
to sort messages in the order the writing MUA meant to, by sorting
numeric segment in numeric order and non-numeric segment in
alphabetical order.

* jk/mailsplit-maildir-muttsort:
  mailsplit: sort maildir filenames more cleverly
2013-03-26 12:44:11 -07:00
Junio C Hamano 7d2726c393 Merge branch 'rs/zip-compresssed-size-with-export-subst' into maint
When export-subst is used, "zip" output recorded incorrect
size of the file.

* rs/zip-compresssed-size-with-export-subst:
  archive-zip: fix compressed size for stored export-subst files
2013-03-26 12:43:49 -07:00
Junio C Hamano d7cccbb3bb Merge branch 'jk/utf-8-can-be-spelled-differently' into maint
Some platforms and users spell UTF-8 differently; retry with the
most official "UTF-8" when the system does not understand the
user-supplied encoding name that are the common alternative
spellings of UTF-8.

* jk/utf-8-can-be-spelled-differently:
  utf8: accept alternate spellings of UTF-8
2013-03-26 12:43:25 -07:00
Junio C Hamano 307d68e275 Merge branch 'nd/branch-error-cases' into maint
"git branch" had more cases where it did not bother to check
nonsense command line parameters.

* nd/branch-error-cases:
  branch: segfault fixes and validation
2013-03-26 12:43:05 -07:00
Junio C Hamano 6201eb3e65 Merge branch 'ap/maint-update-index-h-is-for-help' into maint
"git update-index -h" did not do the usual "-h(elp)" thing.

* ap/maint-update-index-h-is-for-help:
  update-index: allow "-h" to also display options
2013-03-26 12:42:42 -07:00