Commit graph

7575 commits

Author SHA1 Message Date
Junio C Hamano 561954bfa1 Merge branch 'jc/add-2.0-delete-default' (early part)
Preparatory steps to make "git add <pathspec>" take notice of
removed paths that match <pathspec> by default in Git 2.0.

* 'jc/add-2.0-delete-default' (early part):
  git add: rephrase the "removal will cease to be ignored" warning
  git add: rework the logic to warn "git add <pathspec>..." default change
  git add: start preparing for "git add <pathspec>..." to default to "-A"
  builtin/add.c: simplify boolean variables
2013-04-22 11:11:45 -07:00
Junio C Hamano de0d774d46 Merge branch 'nd/checkout-keep-sparse'
Make the initial "sparse" selection of the paths more sticky across
"git checkout".

* nd/checkout-keep-sparse:
  checkout: add --ignore-skip-worktree-bits in sparse checkout mode
2013-04-22 11:11:40 -07:00
Junio C Hamano 703319313f Merge branch 'jk/chopped-ident'
A commit object whose author or committer ident are malformed
crashed some code that trusted that a name, an email and an
timestamp can always be found in it.

* jk/chopped-ident:
  blame: handle broken commit headers gracefully
  pretty: handle broken commit headers gracefully
  cat-file: print tags raw for "cat-file -p"
2013-04-22 11:11:36 -07:00
Junio C Hamano 1fc0bfd65a Merge branch 'th/bisect-final-log'
Leave a commit to note what the final outcome was in the bisect log
file.

* th/bisect-final-log:
  bisect: Store first bad commit as comment in log file
2013-04-22 11:11:08 -07:00
Junio C Hamano c6c4d61673 Merge branch 'jk/doc-http-backend'
Improve documentation to illustrate "push authenticated, fetch
anonymous" configuration for smart HTTP servers.

* jk/doc-http-backend:
  doc/http-backend: match query-string in apache half-auth example
  doc/http-backend: give some lighttpd config examples
  doc/http-backend: clarify "half-auth" repo configuration
2013-04-21 18:40:09 -07:00
Junio C Hamano 6ae5d9863b Merge branch 'rt/commentchar-fmt-merge-msg'
A test fix for recent update.

* rt/commentchar-fmt-merge-msg:
  t6200: avoid path mangling issue on Windows
2013-04-19 13:45:01 -07:00
Junio C Hamano 4407ea49fe Merge branch 'mv/sequencer-pick-error-diag'
"git cherry-pick $blob $tree" is diagnosed as a nonsense.

* mv/sequencer-pick-error-diag:
  cherry-pick: make sure all input objects are commits
2013-04-19 13:40:23 -07:00
Nguyễn Thái Ngọc Duy 1640632b4f pretty: support %>> that steal trailing spaces
This is pretty useful in `%<(100)%s%Cred%>(20)% an' where %s does not
use up all 100 columns and %an needs more than 20 columns. By
replacing %>(20) with %>>(20), %an can steal spaces from %s.

%>> understands escape sequences, so %Cred does not stop it from
stealing spaces in %<(100).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy a7f01c6b4d pretty: support truncating in %>, %< and %><
%>(N,trunc) truncates the right part after N columns and replace the
last two letters with "..". ltrunc does the same on the left. mtrunc
cuts the middle out.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy a57523428b pretty: support padding placeholders, %< %> and %><
Either %<, %> or %>< standing before a placeholder specifies how many
columns (at least as the placeholder can exceed it) it takes. Each
differs on how spaces are padded:

  %< pads on the right (aka left alignment)
  %> pads on the left (aka right alignment)
  %>< pads both ways equally (aka centered)

The (<N>) follows them, e.g. `%<(100)', to specify the number of
columns the next placeholder takes.

However, if '|' stands before (<N>), e.g. `%>|(100)', then the number
of columns is calculated so that it reaches the Nth column on screen.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy 7e77df39bf pretty: two phase conversion for non utf-8 commits
Always assume format_commit_item() takes an utf-8 string for string
handling simplicity (we can handle utf-8 strings, but can't with other
encodings).

If commit message is in non-utf8, or output encoding is not, then the
commit is first converted to utf-8, processed, then output converted
to output encoding. This of course only works with encodings that are
compatible with Unicode.

This also fixes the iso8859-1 test in t6006. It's supposed to create
an iso8859-1 commit, but the commit content in t6006 is in UTF-8.
t6006 is now converted back in UTF-8 (the downside is we can't put
utf-8 strings there anymore).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 16:28:28 -07:00
Nguyễn Thái Ngọc Duy 9d3f002f21 pretty: share code between format_decoration and show_decorations
This also adds color support to format_decorations()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 16:28:27 -07:00
Junio C Hamano ded56521bd Merge branch 'jk/test-trash'
Fix longstanding issues with the test harness when used with --root=<there>
option.

* jk/test-trash:
  t/test-lib.sh: drop "$test" variable
  t/test-lib.sh: fix TRASH_DIRECTORY handling
2013-04-18 11:49:45 -07:00
Junio C Hamano da89885c6d Merge branch 'th/t9903-symlinked-workdir'
* th/t9903-symlinked-workdir:
  t9903: Don't fail when run from path accessed through symlink
2013-04-18 11:49:42 -07:00
Junio C Hamano e7e656c09a Merge branch 'jk/merge-tree-added-identically'
The resolution of some corner cases by "git merge-tree" were
inconsistent between top-of-the-tree and in a subdirectory.

* jk/merge-tree-added-identically:
  merge-tree: don't print entries that match "local"
2013-04-18 11:49:31 -07:00
Junio C Hamano 77354d8cdc Merge branch 'jk/http-dumb-namespaces'
Allow smart-capable HTTP servers to be restricted via the
GIT_NAMESPACE mechanism when talking with commit-walker clients
(they already do so when talking with smart HTTP clients).

* jk/http-dumb-namespaces:
  http-backend: respect GIT_NAMESPACE with dumb clients
2013-04-18 11:49:21 -07:00
Junio C Hamano 1931f6d6ea Merge branch 'rs/empty-archive'
Implementations of "tar" of BSD descend have found to have trouble
with reading an otherwise empty tar archive with pax headers and
causes an unnecessary test failure.

* rs/empty-archive:
  t5004: fix issue with empty archive test and bsdtar
2013-04-18 11:49:17 -07:00
Junio C Hamano 288aa7534a Merge branch 'fc/send-email-annotate'
Allows format-patch --cover-letter to be configurable; the most
notable is the "auto" mode to create cover-letter only for multi
patch series.

* fc/send-email-annotate:
  rebase-am: explicitly disable cover-letter
  format-patch: trivial cleanups
  format-patch: add format.coverLetter configuration variable
  log: update to OPT_BOOL
  format-patch: refactor branch name calculation
  format-patch: improve head calculation for cover-letter
  send-email: make annotate configurable
2013-04-18 11:49:11 -07:00
Junio C Hamano 54a3c67375 Merge branch 'jc/push-2.0-default-to-simple' (early part)
Adjust our tests for upcoming migration of the default value for the
"push.default" configuration variable to "simple" from "mixed".

* 'jc/push-2.0-default-to-simple' (early part):
  t5570: do not assume the "matching" push is the default
  t5551: do not assume the "matching" push is the default
  t5550: do not assume the "matching" push is the default
  t9401: do not assume the "matching" push is the default
  t9400: do not assume the "matching" push is the default
  t7406: do not assume the "matching" push is the default
  t5531: do not assume the "matching" push is the default
  t5519: do not assume the "matching" push is the default
  t5517: do not assume the "matching" push is the default
  t5516: do not assume the "matching" push is the default
  t5505: do not assume the "matching" push is the default
  t5404: do not assume the "matching" push is the default
2013-04-18 11:47:59 -07:00
Junio C Hamano 5734fa4608 Merge branch 'fc/completion'
In addition to a user visible change to offer more options to cherry-pick,
generally cleans up and simplifies the code.

* fc/completion:
  completion: small optimization
  completion: inline __gitcomp_1 to its sole callsite
  completion: get rid of compgen
  completion: add __gitcomp_nl tests
  completion: add new __gitcompadd helper
  completion: get rid of empty COMPREPLY assignments
  completion: trivial test improvement
  completion: add more cherry-pick options
2013-04-18 11:46:42 -07:00
Johannes Sixt 16a794de88 t6200: avoid path mangling issue on Windows
MSYS bash interprets the slash in the argument core.commentchar="/"
as root directory and mangles it into a Windows style path. Use a
different core.commentchar to dodge the issue.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 09:56:37 -07:00
René Scharfe 9dbe7c3d7f pretty: handle broken commit headers gracefully
Centralize the parsing of the date and time zone strings in the new
helper function show_ident_date() and make sure it checks the pointers
provided by split_ident_line() for NULL before use.

Reported-by: Ivan Lyapunov <dront78@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 14:50:36 -07:00
Jeff King 9cfa5126a0 cat-file: print tags raw for "cat-file -p"
When "cat-file -p" prints commits, it shows them in their
raw format, since git's format is already human-readable.
For tags, however, we print the whole thing raw except for
one thing: we convert the timestamp on the tagger line into a
human-readable date.

This dates all the way back to a0f15fa (Pretty-print tagger
dates, 2006-03-01). At that time there was no other way to
pretty-print a tag.  These days, however, neither of those
matters much. The normal way to pretty-print a tag is with
"git show", which is much more flexible than "cat-file -p".

Commit a0f15fa also built "verify-tag --verbose" (and
subsequently "tag -v") around the "cat-file -p" output.
However, that behavior was lost in commit 62e09ce (Make git
tag a builtin, 2007-07-20), and we went back to printing
the raw tag contents. Nobody seems to have noticed the bug
since then (and it is arguably a saner behavior anyway, as
it shows the actual bytes for which we verified the
signature).

Let's drop the tagger-date formatting for "cat-file -p". It
makes us more consistent with cat-file's commit
pretty-printer, and as a bonus, we can drop the hand-rolled
tag parsing code in cat-file (which happened to behave
inconsistently with the tag pretty-printing code elsewhere).

This is a change of output format, so it's possible that
some callers could considered this a regression. However,
the original behavior was arguably a bug (due to the
inconsistency with commits), likely nobody was relying on it
(even we do not use it ourselves these days), and anyone
relying on the "-p" pretty-printer should be able to expect
a change in the output format (i.e., while "cat-file" is
plumbing, the output format of "-p" was never guaranteed to
be stable).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 14:48:45 -07:00
Junio C Hamano 948cf4f5e5 Merge branch 'rt/commentchar-fmt-merge-msg'
The new core.commentchar configuration was not applied to a few
places.

* rt/commentchar-fmt-merge-msg:
  fmt-merge-msg: use core.commentchar in tag signatures completely
  fmt-merge-msg: respect core.commentchar in people credits
2013-04-15 12:40:56 -07:00
Junio C Hamano e1a3f17e9d Merge branch 'lf/bundle-with-tip-wo-message'
"git bundle" did not like a bundle created using a commit without
any message as its one of the prerequistes.

* lf/bundle-with-tip-wo-message:
  bundle: Accept prerequisites without commit messages
2013-04-15 12:40:51 -07:00
Junio C Hamano d809d050ff Merge branch 'tr/perl-keep-stderr-open'
Closing (not redirecting to /dev/null) the standard error stream is
not a very smart thing to do.  Later open may return file
descriptor #2 for unrelated purpose, and error reporting code may
write into them.

* tr/perl-keep-stderr-open:
  t9700: do not close STDERR
  perl: redirect stderr to /dev/null instead of closing
2013-04-15 12:40:41 -07:00
Karsten Blees 5bd8e2d894 dir.c: git-clean -d -X: don't delete tracked directories
The notion of "ignored tracked" directories introduced in 721ac4ed "dir.c:
Make git-status --ignored more consistent" has a few unwanted side effects:

 - git-clean -d -X: deletes ignored tracked directories. git-clean should
   never delete tracked content.

 - git-ls-files --ignored --other --directory: lists ignored tracked
   directories instead of "other" directories.

 - git-status --ignored: lists ignored tracked directories while contained
   files may be listed as modified. Paths listed by git-status should be
   disjoint (except in long format where a path may be listed in both the
   staged and unstaged section).

Additionally, the current behaviour violates documentation in gitignore(5)
("Specifies intentionally *untracked* files to ignore") and Documentation/
technical/api-directory-listing.txt ("DIR_SHOW_OTHER_DIRECTORIES: Include
a directory that is *not tracked*.").

In dir.c::treat_directory, remove the special handling of ignored tracked
directories, so that the DIR_SHOW_OTHER_DIRECTORIES flag only affects
"other" (i.e. untracked) directories. In dir.c::dir_add_name, check that
added paths are untracked even if DIR_SHOW_IGNORED is set.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:34:00 -07:00
Karsten Blees be8a84c526 dir.c: make 'git-status --ignored' work within leading directories
'git-status --ignored path/' doesn't list ignored files and directories
within 'path' if some component of 'path' is classified as untracked.

Disable the DIR_SHOW_OTHER_DIRECTORIES flag while traversing leading
directories. This prevents treat_leading_path() with DIR_SHOW_IGNORED flag
from aborting at the top level untracked directory.

As a side effect, this also eliminates a recursive directory scan per
leading directory level, as treat_directory() can no longer call
read_directory_recursive() when called from treat_leading_path().

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:59 -07:00
Karsten Blees c94ab01026 dir.c: git-status --ignored: don't list empty directories as ignored
'git-status --ignored' lists empty untracked directories as ignored, even
though they don't have any ignored files.

When checking if a directory is already listed as untracked (i.e. shouldn't
be listed as ignored as well), don't assume that the directory has only
ignored files if it doesn't have untracked files, as the directory may be
empty.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:59 -07:00
Karsten Blees 184d2a8e96 dir.c: git-ls-files --directories: don't hide empty directories
'git-ls-files --ignored --directories' hides empty directories even though
--no-empty-directory was not specified.

Treat the DIR_HIDE_EMPTY_DIRECTORIES flag independently from
DIR_SHOW_IGNORED to make all git-ls-files options work as expected.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:59 -07:00
Karsten Blees 0104c9e781 dir.c: git-status --ignored: don't list empty ignored directories
'git-status --ignored' lists ignored tracked directories without any
ignored files if a tracked file happens to match an exclude pattern.

Always exclude tracked files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:58 -07:00
Karsten Blees 289ff5598f dir.c: git-status --ignored: don't list files in ignored directories
'git-status --ignored' lists both the ignored directory and the ignored
files if the files are in a tracked sub directory.

When recursing into sub directories in read_directory_recursive, pass on
the check_only parameter so that we don't accidentally add the files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:58 -07:00
Karsten Blees 560bb7a7a1 dir.c: git-status --ignored: don't drop ignored directories
'git-status --ignored' drops ignored directories if they contain untracked
files in an untracked sub directory.

Fix it by getting exact (recursive) excluded status in treat_directory.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:33:58 -07:00
Torstein Hegge a7f8b8ac94 bisect: Store first bad commit as comment in log file
When bisect successfully finds a single revision, the first bad commit
should be shown to human readers of 'git bisect log'.

This resolves the apparent disconnect between the bisection result and
the log when a bug reporter says "I know that the first bad commit is
$rev, as you can see from $(git bisect log)".

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 09:05:42 -07:00
John Keeping 0d957a4df5 transport-helper: add 'signed-tags' capability
This allows a remote helper using the 'export' protocol to specify that
it supports signed tags, changing the handing from 'warn-strip' to
'verbatim'.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 09:04:43 -07:00
John Keeping b8bd826f3a transport-helper: pass --signed-tags=warn-strip to fast-export
Currently, attempting to push a signed tag to a remote helper which uses
fast-export results in the remote helper failing because the default
fast-export action for signed tags is "abort".  This is not helpful for
users because there is no way to pass additional arguments to
fast-export here, either from the remote helper or from the command
line.

In general, the signature will be invalidated by whatever transformation
a remote helper performs on a tag to push it to a repository in a
different format so the correct behaviour is to strip the tag.  Doing
this silently may surprise people, so use "warn-strip" to issue a
warning when a signed tag is encountered.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 09:03:16 -07:00
John Keeping cd16c59bfa fast-export: add --signed-tags=warn-strip mode
This issues a warning while stripping signatures from signed tags, which
allows us to use it as default behaviour for remote helpers which cannot
specify how to handle signed tags.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 09:02:25 -07:00
Nguyễn Thái Ngọc Duy 08d595dc1c checkout: add --ignore-skip-worktree-bits in sparse checkout mode
"git checkout -- <paths>" is usually used to restore all modified
files in <paths>. In sparse checkout mode, this command is overloaded
with another meaning: to add back all files in <paths> that are
excluded by sparse patterns.

As the former makes more sense for day-to-day use. Switch it to the
default and the latter enabled with --ignore-skip-worktree-bits.

While at there, add info/sparse-checkout to gitrepository-layout.txt

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 08:54:45 -07:00
Jeff King 002d4ce8aa t/test-lib.sh: drop "$test" variable
The $test variable is used as an interim buffer for
constructing $TRASH_DIRECTORY, and is almost compatible with
it (the exception being that $test has not been converted to
an absolute path). Let's get rid of it entirely so that
later code does not accidentally use it, thinking the two
are interchangeable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:30:57 -07:00
John Keeping 38b074de80 t/test-lib.sh: fix TRASH_DIRECTORY handling
After the location of $TRASH_DIRECTORY is adjusted by
$TEST_OUTPUT_DIRECTORY, we go on to use the $test variable to make the
trash directory and cd into it.  This means that when
$TEST_OUTPUT_DIRECTORY is not "." and an absolute --root has not been
specified, we do not remove the trash directory once the tests are
complete (remove_trash is set to $TRASH_DIRECTORY).

Fix this by always referring to the trash directory as $TRASH_DIRECTORY.

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Jeff King <peff@peff.net>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:30:21 -07:00
Felipe Contreras 7d13e0a3af completion: get rid of compgen
The functionality we use from compgen is not much, we can do the same
manually, with drastic improvements in speed, especially when dealing
with only a few words.

This patch also has the sideffect that brekage reported by Jeroen Meijer
and SZEDER Gábor gets fixed because we no longer expand the resulting
words.

Here are some numbers filtering N amount of words:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.000s
  == 100 ==
  original: 0.003s
  new: 0.002s
  == 1000 ==
  original: 0.012s
  new: 0.011s
  == 10000 ==
  original: 0.056s
  new: 0.066s
  == 100000 ==
  original: 2.669s
  new: 0.622s

If the results are not narrowed:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.001s
  == 100 ==
  original: 0.004s
  new: 0.004s
  == 1000 ==
  original: 0.020s
  new: 0.015s
  == 10000 ==
  original: 0.101s
  new: 0.355s
  == 100000 ==
  original: 2.850s
  new: 31.941s

So, unless 'git checkout <tab>' usually gives you more than 10000
results, you'll get an improvement :)

Other possible solutions perform better after 1000 words, but worst if
less than that:

  COMPREPLY=($(awk -v cur="$3" -v pre="$2" -v suf="$4"
	'$0 ~ cur { print pre$0suf }' <<< "$1" ))

  COMPREPLY=($(printf -- "$2%s$4\n" $1 | grep "^$2$3"))

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Felipe Contreras 43369a2258 completion: add __gitcomp_nl tests
Original patch by SZEDER Gábor.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Jeff King b0808819e5 doc/http-backend: match query-string in apache half-auth example
When setting up a "half-auth" repository in which reads can
be done anonymously but writes require authentication, it is
best if the server can require authentication for both the
ref advertisement and the actual receive-pack POSTs. This
alleviates the need for the admin to set http.receivepack in
the repositories, and means that the client is challenged
for credentials immediately, instead of partway through the
push process (and git clients older than v1.7.11.7 had
trouble handling these challenges).

Since detecting a push during the ref advertisement requires
matching the query string, and this is non-trivial to do in
Apache, we have traditionally punted and instructed users to
just protect "/git-receive-pack$".  This patch provides the
mod_rewrite recipe to actually match the ref advertisement,
which is preferred.

While we're at it, let's add the recipe to our test scripts
so that we can be sure that it works, and doesn't get broken
(either by our changes or by changes in Apache).

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-13 22:27:06 -07:00
Junio C Hamano caa7d79f1f Sync with 'maint'
* maint:
  Correct common spelling mistakes in comments and tests
  kwset: fix spelling in comments
  precompose-utf8: fix spelling of "want" in error message
  compat/nedmalloc: fix spelling in comments
  compat/regex: fix spelling and grammar in comments
  obstack: fix spelling of similar
  contrib/subtree: fix spelling of accidentally
  git-remote-mediawiki: spelling fixes
  doc: various spelling fixes
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format
  i18n: make the translation of -u advice in one go
2013-04-12 13:54:01 -07:00
Junio C Hamano a46221e9ad Merge branch 'rr/test-3200-style' into maint
* rr/test-3200-style:
  t3200 (branch): modernize style

Conflicts:
	t/t3200-branch.sh
2013-04-12 13:41:48 -07:00
Junio C Hamano 6a293703af Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into maint
* jc/t5516-pushInsteadOf-vs-pushURL:
  t5516: test interaction between pushURL and pushInsteadOf correctly
2013-04-12 13:41:45 -07:00
Stefano Lattarini 41ccfdd9c9 Correct common spelling mistakes in comments and tests
Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 13:38:40 -07:00
Felipe Contreras cdbff7d6ad completion: trivial test improvement
Instead of passing a dummy "", let's check if the last character is a
space, and then move the _cword accordingly.

Apparently we were passing "" all the way to compgen, which fortunately
expanded it to nothing.

Lets do the right thing though.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 10:44:53 -07:00
Junio C Hamano e2af9e361b Merge branch 'maint'
* maint:
  Typo fix: replacing it's -> its
  t: make PIPE a standard test prerequisite
  archive: clarify explanation of --worktree-attributes
  t/README: --immediate skips cleanup commands for failed tests
2013-04-11 17:41:48 -07:00
Junio C Hamano a15696bb46 Merge branch 'ap/combine-diff-coalesce-lost'
Attempts to minimize "diff -c/--cc" output by coalescing the same
lines removed from the parents better, but with an O(n^2)
complexity.

* ap/combine-diff-coalesce-lost:
  combine-diff: coalesce lost lines optimally
2013-04-11 17:41:06 -07:00
Junio C Hamano 0d2f94ac95 Merge branch 'sr/log-SG-no-textconv'
"git log -S/-G" started paying attention to textconv filter, but
there was no way to disable this.  Make it honor --no-textconv
option.

* sr/log-SG-no-textconv:
  diffcore-pickaxe: unify code for log -S/-G
  diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"
  diffcore-pickaxe: port optimization from has_changes() to diff_grep()
  diffcore-pickaxe: respect --no-textconv
  diffcore-pickaxe: remove fill_one()
  diffcore-pickaxe: remove unnecessary call to get_textconv()
2013-04-11 17:41:04 -07:00
Junio C Hamano 5beeefea31 Merge branch 'js/rerere-forget-protect-against-NUL'
A few bugfixes to "git rerere" working on corner case merge
conflicts.

* js/rerere-forget-protect-against-NUL:
  rerere forget: do not segfault if not all stages are present
  rerere forget: grok files containing NUL
2013-04-11 17:41:02 -07:00
Adam Spiers 200732744a t: make PIPE a standard test prerequisite
The 'PIPE' test prerequisite was already defined identically by t9010
and t9300, therefore it makes sense to make it a predefined
prerequisite.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 17:39:05 -07:00
Torstein Hegge 3ba40b45d8 t9903: Don't fail when run from path accessed through symlink
When the git directory is accessed through a symlink like

  ln -s /tmp/git /tmp/git-symlink
  cd /tmp/git-symlink/t
  make -C .. && ./t9903-bash-prompt.sh

$TRASH_DIRECTORY is /tmp/git-symlink/t/trash directory.t9903-bash-prompt
and $(pwd -P) is /tmp/git/t/trash directory.t9903-bash-prompt.

When __gitdir looks up the path through 'git rev-parse --git-dir', it
will return paths similar to $(pwd -P). This behavior is already tested in
t9903 'gitdir - resulting path avoids symlinks'.

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 16:07:22 -07:00
Miklos Vajna 21246dbb9e cherry-pick: make sure all input objects are commits
When a single argument was a non-commit, the error message used to be:

	fatal: BUG: expected exactly one commit from walk

For multiple arguments, when none of the arguments was a commit, the error was:

	fatal: empty commit set passed

Finally, when some of the arguments were non-commits, we ignored those
arguments.  Fix this bug and make sure all arguments are commits, and
for the first non-commit, error out with:

	fatal: <name>: Can't cherry-pick a <type>

Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 09:54:25 -07:00
René Scharfe 24676f02ba t5004: fix issue with empty archive test and bsdtar
bsdtar, which is the default tar on Mac OS X, handles empty archives
just fine but reports archives containing only a pax extended header
comment as damaged.  Work around the issue by explicitly generating
the archive for the tree and not the commit, which causes git archive
to omit the commit hash comment record from the tar file.

Reported-by: BJ Hargrave <bj@bjhargrave.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-10 12:26:14 -07:00
John Koleszar 6130f86dea http-backend: respect GIT_NAMESPACE with dumb clients
Filter the list of refs returned via the dumb HTTP protocol according
to the active namespace, consistent with other clients of the
upload-pack service.

Signed-off-by: John Koleszar <jkoleszar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-09 18:06:44 -07:00
Aaron Schrab b552b56df2 clone: Allow repo using gitfile as a reference
Try reading gitfile files when processing --reference options to clone.
This will allow, among other things, using a submodule checked out with
a recent version of git as a reference repository without requiring the
user to have internal knowledge of submodule layout.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-09 15:40:00 -07:00
Simon Ruderich 13cb3bb7e6 t/README: --immediate skips cleanup commands for failed tests
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-09 15:12:28 -07:00
Junio C Hamano 0290bf1250 Revert 4b7f53da76 (simplify-merges: drop merge from irrelevant side branch, 2013-01-17)
Kevin Bracey reports that the change regresses a case shown in the
user manual.

Trading one fix with another breakage is not worth it.  Just keep
the test to document the existing breakage, and revert the change
for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 13:10:27 -07:00
John Keeping aacecc3b36 merge-tree: don't print entries that match "local"
The documentation says:

	the output from the command omits entries that match the
	<branch1> tree.

But currently "added in branch1" and "removed in branch1" (both while
unchanged in branch2) do print output.  Change this so that the
behaviour matches the documentation.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 10:50:52 -07:00
Lukas Fleischer 5446e33f35 bundle: Accept prerequisites without commit messages
While explicitly stating that the commit message in a prerequisite
line is optional, we required all lines with 40 or more characters
to contain a space after the object name, bailing out if a line
consisted of an object name only. This was to allow bundling a
history to a commit without an message, but the code forgot that it
already called rtrim() to remove that whitespace.

As a workaround, only check for SP when the line has more than 40
characters.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 14:45:56 -07:00
Junio C Hamano 0f3d66c6dc Merge branch 'jk/rm-removed-paths'
A handful of test cases and a corner case bugfix for "git rm".

* jk/rm-removed-paths:
  t3600: document failure of rm across symbolic links
  t3600: test behavior of reverse-d/f conflict
  rm: do not complain about d/f conflicts during deletion
2013-04-07 14:33:14 -07:00
Junio C Hamano 4d35924e3a Merge branch 'rr/triangle'
Support "pull from one place, push to another place" workflow
better by introducing remote.pushdefault (overrides the "origin"
thing) and branch.*.pushremote (overrides the branch.*.remote).

* rr/triangle:
  remote.c: introduce branch.<name>.pushremote
  remote.c: introduce remote.pushdefault
  remote.c: introduce a way to have different remotes for fetch/push
  t5516 (fetch-push): drop implicit arguments from helper functions
  t5516 (fetch-push): update test description
  remote.c: simplify a bit of code using git_config_string()
2013-04-07 14:32:50 -07:00
Junio C Hamano e64734b6a0 Merge branch 'mm/status-during-revert'
"git status" learned to report that you are in the middle of a
revert session, just like it does for a cherry-pick and a bisect
session.

* mm/status-during-revert:
  status: show commit sha1 in "You are currently reverting" message
  status: show 'revert' state and status hint
2013-04-07 14:32:03 -07:00
Junio C Hamano 88dccb6c98 Merge branch 'jk/set-upstream-error-cases'
The handing by "git branch --set-upstream-to" against various forms
of errorneous inputs were suboptimal.

* jk/set-upstream-error-cases:
  branch: give advice when tracking start-point is missing
  branch: mention start_name in set-upstream error messages
  branch: improve error message for missing --set-upstream-to ref
  branch: factor out "upstream is not a branch" error messages
  t3200: test --set-upstream-to with bogus refs
2013-04-07 14:31:08 -07:00
Junio C Hamano 9a11f13d9e Merge branch 'jk/filter-branch-come-back-to-original'
When used with "-d temporary-directory" option, "git filter-branch"
failed to come back to the original working tree to perform the
final clean-up procedure.

* jk/filter-branch-come-back-to-original:
  filter-branch: return to original dir after filtering
2013-04-07 14:29:34 -07:00
Felipe Contreras 2a4c26076c format-patch: add format.coverLetter configuration variable
Also, add a new option: 'auto', so if there's more than one patch, the
cover letter is generated, otherwise it's not.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 13:37:47 -07:00
Felipe Contreras 80d35ca0aa format-patch: improve head calculation for cover-letter
If we do it after the revision traversal we can be sure that this is
indeed a commit that will be processed (i.e. not a merge) and it's the
top most one (thus removing the NEEDSWORK comment, at least we show the
same as 'git diff --stat' output that appears in the cover-letter).

While we are at it, since we know there's nothing to generate, exit
sooner in all cases, like --cover-letter currently does.

Also, if there's nothing to generate and cover-letter is specified, a
different code-path might be triggered that is not currently covered in
the test-case, so add a test for it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 13:32:41 -07:00
Junio C Hamano 6466fbbeef Sync with 1.8.1.6 2013-04-07 13:17:50 -07:00
Ralf Thielow 9927ebed19 fmt-merge-msg: respect core.commentchar in people credits
Commit eff80a9 (Allow custom "comment char") introduced a custom
comment character for commit messages but forgot to use it in
people credits which can be a part of a commit message.

With this commit, the custom comment character is also used
in people credits.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 09:28:29 -07:00
Junio C Hamano 4bbb830a35 Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1
A pattern "dir" (without trailing slash) in the attributes file
stopped matching a directory "dir" by mistake with an earlier change
that wanted to allow pattern "dir/" to also match.

* jc/directory-attrs-regression-fix:
  t: check that a pattern without trailing slash matches a directory
  dir.c::match_pathname(): pay attention to the length of string parameters
  dir.c::match_pathname(): adjust patternlen when shifting pattern
  dir.c::match_basename(): pay attention to the length of string parameters
  attr.c::path_matches(): special case paths that end with a slash
  attr.c::path_matches(): the basename is part of the pathname
2013-04-07 08:45:03 -07:00
Junio C Hamano d5fec92a7a Merge branch 'sg/gpg-sig'
Teach "merge/pull" to optionally verify and reject commits that are
not signed properly.

* sg/gpg-sig:
  pretty printing: extend %G? to include 'N' and 'U'
  merge/pull Check for untrusted good GPG signatures
  merge/pull: verify GPG signatures of commits being merged
  commit.c/GPG signature verification: Also look at the first GPG status line
  Move commit GPG signature verification to commit.c
2013-04-05 14:15:16 -07:00
Junio C Hamano 7b72ec5e14 Merge branch 'jl/submodule-deinit'
A finishing touch to the new topic in 1.8.3.

* jl/submodule-deinit:
  submodule deinit: clarify work tree removal message
2013-04-05 14:15:13 -07:00
Junio C Hamano e636241fdb Merge branch 'jc/merge-tag-object'
"git merge $(git rev-parse v1.8.2)" behaved quite differently from
"git merge v1.8.2" as if v1.8.2 were written as v1.8.2^0 and did
not pay much attention to the annotated tag payload.

This makes the code notice the type of the tag object, in addition
to the dwim_ref() based classification the current code uses
(i.e. the name appears in refs/tags/) to decide when to special
case merging of tags.

* jc/merge-tag-object:
  t6200: test message for merging of an annotated tag
  t6200: use test_config/test_unconfig
  merge: a random object may not necssarily be a commit
2013-04-05 14:14:41 -07:00
Simon Ruderich a8f6109428 diffcore-pickaxe: respect --no-textconv
git log -S doesn't respect --no-textconv:

    $ echo '*.txt diff=wrong' > .gitattributes
    $ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo
    error: cannot run xxx: No such file or directory
    fatal: unable to read files to diff

Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05 10:30:44 -07:00
Jeff King 03415ca8db t3600: document failure of rm across symbolic links
If we have a symlink "d" that points to a directory, we
should not be able to remove "d/f". In the normal case,
where "d/f" does not exist in the index, we already disallow
this, as we only remove things that git knows about in the
index. So for something like:

  ln -s /outside/repo foo
  git add foo
  git rm foo/bar

we will properly produce an error (as there is no index
entry for foo/bar). However, if there is an index entry for
the path (e.g., because the movement is due to working tree
changes that have not yet been reflected in the index), we
will happily delete it, even though the path we delete from the
filesystem is not the same as the path in the index.

This patch documents that failure with a test.

While this is a bug, it should not be possible to cause
serious data loss with it. For any path that does not have
an index entry, we will complain and bail. For a path which
does have an index entry, we will do the usual up-to-date
content check. So even if the deleted path in the filesystem
is not the same as the one we are removing from the index,
we do know that they at least have the same content, and
that the content is included in HEAD.

That means the worst case is not the accidental loss of
content, but rather confusion by the user when a copy of a
file another part of the tree is removed. Which makes this
bug a minor and hard-to-trigger annoyance rather than a
data-loss bug (and hence the fix can be saved for a rainy
day when somebody feels like working on it).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 21:54:07 -07:00
Thomas Rast a749c0bbef t9700: do not close STDERR
Much like the previous patch, this triggered an unrelated bug.
Closing STDERR is not worth it anyway, as we risk writing die() and
such to random files that happen to be subsequently opened on FD 2.
Don't do it.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 14:49:56 -07:00
Junio C Hamano 5ccb7e2ef3 Merge branch 'jk/peel-ref' into maint
* jk/peel-ref:
  upload-pack: load non-tip "want" objects from disk
  upload-pack: make sure "want" objects are parsed
  upload-pack: drop lookup-before-parse optimization
2013-04-04 12:59:55 -07:00
Jeff King 96ec8ee92a t3600: test behavior of reverse-d/f conflict
The previous commit taught "rm" that it is safe to consider
"d/f" removed when "d" has become a non-directory. This
patch adds a test for the opposite: a file "d" that becomes
a directory.

In this case, "git rm" does need to complain, because we
should not be removing arbitrary content under "d". Git
already behaves correctly, but let's make sure that remains
the case by protecting the behavior with a test.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 12:28:53 -07:00
Jeff King 9a6728d4d1 rm: do not complain about d/f conflicts during deletion
If we used to have an index entry "d/f", but "d" has been
replaced by a non-directory entry, the user may still want
to run "git rm" to delete the stale index entry. They could
use "git rm --cached" to just touch the index, but "git rm"
should also work: we explicitly try to handle the case that
the file has already been removed from the working tree.

However, because unlinking "d/f" in this case will not yield
ENOENT, but rather ENOTDIR, we do not notice that the file
is already gone. Instead, we report it as an error.

The simple solution is to treat ENOTDIR in this case exactly
like ENOENT; all we want to know is whether the file is
already gone, and if a leading path is no longer a
directory, then by definition the sub-path is gone.

Reported-by: jpinheiro <7jpinheiro@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 12:28:47 -07:00
Johannes Sixt b9e31f5947 rerere forget: do not segfault if not all stages are present
The loop that fills in the buffers that are later passed to the merge
driver exits early when not all stages of a path are present in the index.
But since the buffer pointers are not initialized in advance, the
subsequent accesses are undefined.

Initialize buffer pointers in advance to avoid undefined behavior later.

That is not sufficient, though, to get correct operation of handle_cache().
The function replays a conflicted merge to extract the part inside the
conflict markers. As written, the loop exits early when a stage is missing.
Consequently, the buffers for later stages that would be present in the
index are not filled in and the merge is replayed with incomplete data.

Fix it by investigating all stages of the given path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 12:27:28 -07:00
Brian Gernhardt ac47a22a7a t5570: do not assume the "matching" push is the default
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 10:02:40 -07:00
Brian Gernhardt bd7ac5990c t5551: do not assume the "matching" push is the default
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 10:02:40 -07:00
Brian Gernhardt c9704aa7ab t5550: do not assume the "matching" push is the default
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 10:02:40 -07:00
Junio C Hamano 41ae34d136 Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL'
Update a test to match the documented interaction between pushURL
and pushInsteadOf.

* jc/t5516-pushInsteadOf-vs-pushURL:
  t5516: test interaction between pushURL and pushInsteadOf correctly
2013-04-03 09:34:49 -07:00
Junio C Hamano d3ea5826e4 Merge branch 'tr/valgrind'
Let us use not just memgrind but other *grind debuggers.

* tr/valgrind:
  tests: notice valgrind error in test_must_fail
  tests --valgrind: provide a mode without --track-origins
  tests: parameterize --valgrind option
  t/README: --valgrind already implies -v
2013-04-03 09:34:44 -07:00
Junio C Hamano 8054b9a615 Merge branch 'jm/branch-rename-nothing-error'
"git branch -m" without any argument noticed an error, but with an
incorrect error message.

* jm/branch-rename-nothing-error:
  branch: give better message when no names specified for rename
2013-04-03 09:34:40 -07:00
Junio C Hamano b9c78e9723 Merge branch 'jk/check-corrupt-objects-carefully'
Have the streaming interface and other codepaths more carefully
examine for corrupt objects.

* jk/check-corrupt-objects-carefully:
  clone: leave repo in place after checkout errors
  clone: run check_everything_connected
  clone: die on errors from unpack_trees
  add tests for cloning corrupted repositories
  streaming_write_entry: propagate streaming errors
  add test for streaming corrupt blobs
  avoid infinite loop in read_istream_loose
  read_istream_filtered: propagate read error from upstream
  check_sha1_signature: check return value from read_istream
  stream_blob_to_fd: detect errors reading from stream
2013-04-03 09:34:29 -07:00
Junio C Hamano a70f4cb5b0 Merge branch 'jc/apply-ws-fix-tab-in-indent'
"git apply --whitespace=fix" was not prepared to see a line getting
longer after fixing whitespaces (e.g. tab-in-indent aka Python).

* jc/apply-ws-fix-tab-in-indent:
  test: resurrect q_to_tab
  apply --whitespace=fix: avoid running over the postimage buffer
2013-04-03 09:34:22 -07:00
Junio C Hamano 288e6ff5a6 Merge branch 'jk/difftool-no-overwrite-on-copyback'
Try to be careful when difftool backend allows the user to write
into the temporary files being shown *and* the user makes changes
to the working tree at the same time. One of the changes has to be
lost in such a case, but at least tell the user what he did.

* jk/difftool-no-overwrite-on-copyback:
  t7800: run --dir-diff tests with and without symlinks
  t7800: fix tests when difftool uses --no-symlinks
  t7800: don't hide grep output
  difftool: don't overwrite modified files
  t7800: move '--symlinks' specific test to the end
2013-04-03 09:34:09 -07:00
Junio C Hamano f30366b27a Merge branch 'jc/directory-attrs-regression-fix'
Fix 1.8.1.x regression that stopped matching "dir" (without
trailing slash) to a directory "dir".

* jc/directory-attrs-regression-fix:
  t: check that a pattern without trailing slash matches a directory
  dir.c::match_pathname(): pay attention to the length of string parameters
  dir.c::match_pathname(): adjust patternlen when shifting pattern
  dir.c::match_basename(): pay attention to the length of string parameters
  attr.c::path_matches(): special case paths that end with a slash
  attr.c::path_matches(): the basename is part of the pathname
2013-04-03 09:34:09 -07:00
Junio C Hamano 97fefaf6d3 Merge branch 'nd/checkout-paths-reduce-match-pathspec-calls'
Consolidate repeated pathspec matches on the same paths, while
fixing a bug in "git checkout dir/" code started from an unmerged
index.

* nd/checkout-paths-reduce-match-pathspec-calls:
  checkout: avoid unnecessary match_pathspec calls
2013-04-03 09:34:00 -07:00
Junio C Hamano 14c79b1faa Merge branch 'bc/commit-complete-lines-given-via-m-option' into maint
'git commit -m "$msg"' used to add an extra newline even when
$msg already ended with one.

* bc/commit-complete-lines-given-via-m-option:
  Documentation/git-commit.txt: rework the --cleanup section
  git-commit: only append a newline to -m mesg if necessary
  t7502: demonstrate breakage with a commit message with trailing newlines
  t/t7502: compare entire commit message with what was expected
2013-04-03 09:26:07 -07:00
Junio C Hamano eeecf39397 Merge branch 'jk/alias-in-bare' into maint
An aliased command spawned from a bare repository that does not say
it is bare with "core.bare = yes" is treated as non-bare by mistake.

* jk/alias-in-bare:
  setup: suppress implicit "." work-tree for bare repos
  environment: add GIT_PREFIX to local_repo_env
  cache.h: drop LOCAL_REPO_ENV_SIZE
2013-04-03 09:25:41 -07:00
Junio C Hamano e6658b9d69 Merge branch 'ks/rfc2047-one-char-at-a-time' into maint
When "format-patch" quoted a non-ascii strings on the header files,
it incorrectly applied rfc2047 and chopped a single character in the
middle of it.

* ks/rfc2047-one-char-at-a-time:
  format-patch: RFC 2047 says multi-octet character may not be split
2013-04-03 09:25:29 -07:00
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 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 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