]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
9 years agoWin32: patch Windows environment on startup
Karsten Blees [Thu, 17 Jul 2014 15:38:05 +0000 (17:38 +0200)] 
Win32: patch Windows environment on startup

Fix Windows specific environment settings on startup rather than checking
for special values on every getenv call.

As a side effect, this makes the patched environment (i.e. with properly
initialized TMPDIR and TERM) available to child processes.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: keep the environment sorted
Karsten Blees [Thu, 17 Jul 2014 15:38:04 +0000 (17:38 +0200)] 
Win32: keep the environment sorted

The Windows environment is sorted, keep it that way for O(log n)
environment access.

Change compareenv to compare only the keys, so that it can be used to
find an entry irrespective of the value.

Change lookupenv to binary seach for an entry. Return one's complement of
the insert position if not found (libc's bsearch returns NULL).

Replace MSVCRT's getenv with a minimal do_getenv based on the binary search
function.

Change do_putenv to insert new entries at the correct position. Simplify
the function by swapping if conditions and using memmove instead of for
loops.

Move qsort from make_environment_block to mingw_startup. We still need to
sort on startup to make sure that the environment is sorted according to
our compareenv function (while Win32 / CreateProcess requires the
environment block to be sorted case-insensitively, CreateProcess currently
doesn't enforce this, and some applications such as bash just don't care).

Note that environment functions are _not_ thread-safe and are not required
to be so by POSIX, the application is responsible for synchronizing access
to the environment. MSVCRT's getenv and our new getenv implementation are
better than that in that they are thread-safe with respect to other getenv
calls as long as the environment is not modified. Git's indiscriminate use
of getenv in background threads currently requires this property.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: use low-level memory allocation during initialization
Karsten Blees [Thu, 17 Jul 2014 15:38:03 +0000 (17:38 +0200)] 
Win32: use low-level memory allocation during initialization

As of d41489a6 "Add more large blob test cases", git's high-level memory
allocation functions (xmalloc, xmemdupz etc.) access the environment to
simulate limited memory in tests (see 'getenv("GIT_ALLOC_LIMIT")' in
memory_limit_check()). These functions should not be used before the
environment is fully initialized (particularly not to initialize the
environment itself).

The current solution ('environ = NULL; ALLOC_GROW(environ...)') only works
because MSVCRT's getenv() reinitializes environ when it is NULL (i.e. it
leaves us with two sets of unusabe (non-UTF-8) and unfreeable (CRT-
allocated) environments).

Add our own set of malloc-or-die functions to be used in startup code.

Also check the result of __wgetmainargs, which may fail if there's not
enough memory for wide-char arguments and environment.

This patch is in preparation of the sorted environment feature, which
completely replaces MSVCRT's getenv() implementation.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: reduce environment array reallocations
Karsten Blees [Thu, 17 Jul 2014 15:38:02 +0000 (17:38 +0200)] 
Win32: reduce environment array reallocations

Move environment array reallocation from do_putenv to the respective
callers. Keep track of the environment size in a global variable. Use
ALLOC_GROW in mingw_putenv to reduce reallocations. Allocate a
sufficiently sized environment array in make_environment_block to prevent
reallocations.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: don't copy the environment twice when spawning child processes
Karsten Blees [Thu, 17 Jul 2014 15:38:01 +0000 (17:38 +0200)] 
Win32: don't copy the environment twice when spawning child processes

When spawning child processes via start_command(), the environment and all
environment entries are copied twice. First by make_augmented_environ /
copy_environ to merge with child_process.env. Then a second time by
make_environment_block to create a sorted environment block string as
required by CreateProcess.

Move the merge logic to make_environment_block so that we only need to copy
the environment once. This changes semantics of the env parameter: it now
expects a delta (such as child_process.env) rather than a full environment.
This is not a problem as the parameter is only used by start_command()
(all other callers previously passed char **environ, and now pass NULL).

The merge logic no longer xstrdup()s the environment strings, so do_putenv
must not free them. Add a parameter to distinguish this from normal putenv.

Remove the now unused make_augmented_environ / free_environ API.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: factor out environment block creation
Karsten Blees [Thu, 17 Jul 2014 15:38:00 +0000 (17:38 +0200)] 
Win32: factor out environment block creation

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: unify environment function names
Karsten Blees [Thu, 17 Jul 2014 15:37:59 +0000 (17:37 +0200)] 
Win32: unify environment function names

Environment helper functions use random naming ('env' prefix or suffix or
both, with or without '_'). Change to POSIX naming scheme ('env' suffix,
no '_').

Env_setenv has more in common with putenv than setenv. Change to do_putenv.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: unify environment case-sensitivity
Karsten Blees [Thu, 17 Jul 2014 15:37:58 +0000 (17:37 +0200)] 
Win32: unify environment case-sensitivity

The environment on Windows is case-insensitive. Some environment functions
(such as unsetenv and make_augmented_environ) have always used case-
sensitive comparisons instead, while others (getenv, putenv, sorting in
spawn*) were case-insensitive.

Prevent potential inconsistencies by using case-insensitive comparison in
lookup_env (used by putenv, unsetenv and make_augmented_environ).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: fix environment memory leaks
Karsten Blees [Thu, 17 Jul 2014 15:37:57 +0000 (17:37 +0200)] 
Win32: fix environment memory leaks

All functions that modify the environment have memory leaks.

Disable gitunsetenv in the Makefile and use env_setenv (via mingw_putenv)
instead (this frees removed environment entries).

Move xstrdup from env_setenv to make_augmented_environ, so that
mingw_putenv no longer copies the environment entries (according to POSIX
[1], "the string [...] shall become part of the environment"). This also
fixes the memory leak in gitsetenv, which expects a POSIX compliant putenv.

[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/putenv.html

Note: This patch depends on taking control of char **environ and having
our own mingw_putenv (both introduced in "Win32: Unicode environment
(incoming)").

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: Unicode environment (incoming)
Karsten Blees [Thu, 17 Jul 2014 15:37:56 +0000 (17:37 +0200)] 
Win32: Unicode environment (incoming)

Convert environment from UTF-16 to UTF-8 on startup.

No changes to getenv() are necessary, as the MSVCRT version is implemented
on top of char **environ.

However, putenv / _wputenv from MSVCRT no longer work, for two reasons:
1. they try to keep environ, _wenviron and the Win32 process environment
in sync, using the default system encoding instead of UTF-8 to convert
between charsets
2. msysgit and MSVCRT use different allocators, memory allocated in git
cannot be freed by the CRT and vice versa

Implement mingw_putenv using the env_setenv helper function from the
environment merge code.

Note that in case of memory allocation failure, putenv now dies with error
message (due to xrealloc) instead of failing with ENOMEM. As git assumes
setenv / putenv to always succeed, this prevents it from continuing with
incorrect settings.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: Unicode environment (outgoing)
Karsten Blees [Thu, 17 Jul 2014 15:37:55 +0000 (17:37 +0200)] 
Win32: Unicode environment (outgoing)

Convert environment from UTF-8 to UTF-16 when creating other processes.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoRevert "Windows: teach getenv to do a case-sensitive search"
Karsten Blees [Thu, 17 Jul 2014 15:37:54 +0000 (17:37 +0200)] 
Revert "Windows: teach getenv to do a case-sensitive search"

This reverts commit df599e9612788b728ce43a03159b85f1fe624d6a.

As of 5e9637c6 "i18n: add infrastructure for translating Git with gettext",
eval_gettext uses MinGW envsubst.exe instead of git-sh-i18n--envsubst.exe
for variable substitution. This breaks git-submodule.sh messages and tests,
as envsubst.exe doesn't support case-sensitive environment lookup (the same
is true for almost everything on Windows, including MSys and Cygwin tools).

30a615ac "Windows/i18n: rename $path to prevent clashes with $PATH" renames
the conflicting variable in git-submodule.sh, so that it works on Windows
(i.e. with case-insensitive environment, regardless of the toolset).

Revert to the documented behaviour of case-insensitive environment on
Windows.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotests: do not pass iso8859-1 encoded parameter
Pat Thoyts [Mon, 2 Sep 2013 14:44:54 +0000 (15:44 +0100)] 
tests: do not pass iso8859-1 encoded parameter

git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW,
because Windows don't let you pass encoded bytes to a process (CreateProcessW
always takes a UTF-16LE encoded string).

It is safe to pass the iso8859-1 message using a file or a pipe.

Thanks-to: Karsten Blees <blees@dcon.de>
Author: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: Unicode file name support (dirent)
Karsten Blees [Sat, 14 Jan 2012 21:01:09 +0000 (22:01 +0100)] 
Win32: Unicode file name support (dirent)

Changes opendir/readdir to use Windows Unicode APIs and convert between
UTF-8/UTF-16.

Removes parameter checks that are already covered by xutftowcs_path. This
changes detection of ENAMETOOLONG from MAX_PATH - 2 to MAX_PATH (matching
is_dir_empty in mingw.c). If name + "/*" or the resulting absolute path is
too long, FindFirstFile fails and errno is set through err_win_to_posix.

Increases the size of dirent.d_name to accommodate the full
WIN32_FIND_DATA.cFileName converted to UTF-8 (UTF-16 to UTF-8 conversion
may grow by factor three in the worst case).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoWin32: Unicode file name support (except dirent)
Karsten Blees [Thu, 15 Mar 2012 17:21:28 +0000 (18:21 +0100)] 
Win32: Unicode file name support (except dirent)

Replaces Windows "ANSI" APIs dealing with file- or path names with their
Unicode equivalent, adding UTF-8/UTF-16LE conversion as necessary.

The dirent API (opendir/readdir/closedir) is updated in a separate commit.

Adds trivial wrappers for access, chmod and chdir.

Adds wrapper for mktemp (needed for both mkstemp and mkdtemp).

The simplest way to convert a repository with legacy-encoded (e.g. Cp1252)
file names to UTF-8 ist to checkout with an old msysgit version and
"git add --all & git commit" with the new version.

Includes a fix for bug reported by John Chen:
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to this commit, these failures were silently ignored due to
strbuf_free in is_dir_empty resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'maint'
Junio C Hamano [Thu, 10 Jul 2014 18:37:56 +0000 (11:37 -0700)] 
Merge branch 'maint'

* maint:
  Start preparing for 2.0.2

9 years agoSeventh batch for 2.1
Junio C Hamano [Thu, 10 Jul 2014 18:37:30 +0000 (11:37 -0700)] 
Seventh batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'dt/refs-check-refname-component-sse-fix'
Junio C Hamano [Thu, 10 Jul 2014 18:27:55 +0000 (11:27 -0700)] 
Merge branch 'dt/refs-check-refname-component-sse-fix'

Fixes to a topic that is already in 'master'.

* dt/refs-check-refname-component-sse-fix:
  refs: fix valgrind suppression file
  refs.c: handle REFNAME_REFSPEC_PATTERN at end of page

9 years agoMerge branch 'rs/simplify-archive-tests'
Junio C Hamano [Thu, 10 Jul 2014 18:27:53 +0000 (11:27 -0700)] 
Merge branch 'rs/simplify-archive-tests'

* rs/simplify-archive-tests:
  t5000, t5003: simplify commit

9 years agoMerge branch 'rs/fix-alt-odb-path-comparison'
Junio C Hamano [Thu, 10 Jul 2014 18:27:52 +0000 (11:27 -0700)] 
Merge branch 'rs/fix-alt-odb-path-comparison'

* rs/fix-alt-odb-path-comparison:
  sha1_file: avoid overrunning alternate object base string

9 years agoMerge branch 'rs/status-code-clean-up'
Junio C Hamano [Thu, 10 Jul 2014 18:27:50 +0000 (11:27 -0700)] 
Merge branch 'rs/status-code-clean-up'

* rs/status-code-clean-up:
  wt-status: simplify building of summary limit argument
  wt-status: use argv_array for environment

9 years agoMerge branch 'kb/path-max-must-go'
Junio C Hamano [Thu, 10 Jul 2014 18:27:47 +0000 (11:27 -0700)] 
Merge branch 'kb/path-max-must-go'

* kb/path-max-must-go:
  symlinks: remove PATH_MAX limitation

9 years agoMerge branch 'mg/verify-commit'
Junio C Hamano [Thu, 10 Jul 2014 18:27:33 +0000 (11:27 -0700)] 
Merge branch 'mg/verify-commit'

Add 'verify-commit' to be used in a way similar to 'verify-tag' is
used.  Further work on verifying the mergetags might be needed.

* mg/verify-commit:
  t7510: test verify-commit
  t7510: exit for loop with test result
  verify-commit: scriptable commit signature verification
  gpg-interface: provide access to the payload
  gpg-interface: provide clear helper for struct signature_check

9 years agoMerge branch 'jc/fix-clone-single-starting-at-a-tag'
Junio C Hamano [Thu, 10 Jul 2014 18:17:24 +0000 (11:17 -0700)] 
Merge branch 'jc/fix-clone-single-starting-at-a-tag'

"git clone -b brefs/tags/bar" would have mistakenly thought we were
following a single tag, even though it was a name of the branch,
because it incorrectly used strstr().

* jc/fix-clone-single-starting-at-a-tag:
  builtin/clone.c: detect a clone starting at a tag correctly

9 years agoStart preparing for 2.0.2
Junio C Hamano [Thu, 10 Jul 2014 18:15:10 +0000 (11:15 -0700)] 
Start preparing for 2.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'pb/trim-trailing-spaces' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:10:52 +0000 (11:10 -0700)] 
Merge branch 'pb/trim-trailing-spaces' into maint

* pb/trim-trailing-spaces:
  t0008: do not depend on 'echo' handling backslashes specially
  dir.c:trim_trailing_spaces(): fix for " \ " sequence

9 years agoMerge branch 'jk/repack-pack-keep-objects' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:10:05 +0000 (11:10 -0700)] 
Merge branch 'jk/repack-pack-keep-objects' into maint

* jk/repack-pack-keep-objects:
  repack: s/write_bitmap/&s/ in code
  repack: respect pack.writebitmaps
  repack: do not accidentally pack kept objects by default

9 years agoMerge branch 'mc/doc-submodule-sync-recurse' into maint
Junio C Hamano [Thu, 10 Jul 2014 18:08:31 +0000 (11:08 -0700)] 
Merge branch 'mc/doc-submodule-sync-recurse' into maint

* mc/doc-submodule-sync-recurse:
  submodule: document "sync --recursive"

9 years agoSixth batch for 2.1
Junio C Hamano [Wed, 9 Jul 2014 18:54:17 +0000 (11:54 -0700)] 
Sixth batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sk/mingw-unicode-spawn-args'
Junio C Hamano [Wed, 9 Jul 2014 18:34:28 +0000 (11:34 -0700)] 
Merge branch 'sk/mingw-unicode-spawn-args'

* sk/mingw-unicode-spawn-args:
  Win32: Unicode arguments (incoming)
  Win32: Unicode arguments (outgoing)
  MinGW: disable CRT command line globbing
  Win32: fix potential multi-threading issue
  Win32: simplify internal mingw_spawn* APIs
  Win32: let mingw_execve() return an int

9 years agoMerge branch 'sk/mingw-dirent'
Junio C Hamano [Wed, 9 Jul 2014 18:34:27 +0000 (11:34 -0700)] 
Merge branch 'sk/mingw-dirent'

* sk/mingw-dirent:
  Win32 dirent: improve dirent implementation
  Win32 dirent: clarify #include directives
  Win32 dirent: change FILENAME_MAX to MAX_PATH
  Win32 dirent: remove unused dirent.d_reclen member
  Win32 dirent: remove unused dirent.d_ino member

9 years agoMerge branch 'sk/mingw-uni-console'
Junio C Hamano [Wed, 9 Jul 2014 18:34:25 +0000 (11:34 -0700)] 
Merge branch 'sk/mingw-uni-console'

* sk/mingw-uni-console:
  Win32: reliably detect console pipe handles
  Win32: fix broken pipe detection
  Win32: Thread-safe windows console output
  Win32: add Unicode conversion functions
  Win32: warn if the console font doesn't support Unicode
  Win32: detect console streams more reliably
  Win32: support Unicode console output

9 years agoMerge branch 'sk/mingw-main'
Junio C Hamano [Wed, 9 Jul 2014 18:34:22 +0000 (11:34 -0700)] 
Merge branch 'sk/mingw-main'

* sk/mingw-main:
  mingw: avoid const warning
  Win32: move main macro to a function

9 years agoMerge branch 'jk/pretty-G-format-fixes'
Junio C Hamano [Wed, 9 Jul 2014 18:34:13 +0000 (11:34 -0700)] 
Merge branch 'jk/pretty-G-format-fixes'

* jk/pretty-G-format-fixes:
  move "%G" format test from t7510 to t6006
  pretty: avoid reading past end-of-string with "%G"
  t7510: check %G* pretty-format output
  t7510: test a commit signed by an unknown key
  t7510: use consistent &&-chains in loop
  t7510: stop referring to master in later tests

9 years agoMerge branch 'jk/xstrfmt'
Junio C Hamano [Wed, 9 Jul 2014 18:34:05 +0000 (11:34 -0700)] 
Merge branch 'jk/xstrfmt'

* jk/xstrfmt:
  setup_git_env(): introduce git_path_from_env() helper
  unique_path: fix unlikely heap overflow
  walker_fetch: fix minor memory leak
  merge: use argv_array when spawning merge strategy
  sequencer: use argv_array_pushf
  setup_git_env: use git_pathdup instead of xmalloc + sprintf
  use xstrfmt to replace xmalloc + strcpy/strcat
  use xstrfmt to replace xmalloc + sprintf
  use xstrdup instead of xmalloc + strcpy
  use xstrfmt in favor of manual size calculations
  strbuf: add xstrfmt helper

9 years agoMerge branch 'jk/skip-prefix'
Junio C Hamano [Wed, 9 Jul 2014 18:33:27 +0000 (11:33 -0700)] 
Merge branch 'jk/skip-prefix'

* jk/skip-prefix:
  http-push: refactor parsing of remote object names
  imap-send: use skip_prefix instead of using magic numbers
  use skip_prefix to avoid repeated calculations
  git: avoid magic number with skip_prefix
  fetch-pack: refactor parsing in get_ack
  fast-import: refactor parsing of spaces
  stat_opt: check extra strlen call
  daemon: use skip_prefix to avoid magic numbers
  fast-import: use skip_prefix for parsing input
  use skip_prefix to avoid repeating strings
  use skip_prefix to avoid magic numbers
  transport-helper: avoid reading past end-of-string
  fast-import: fix read of uninitialized argv memory
  apply: use skip_prefix instead of raw addition
  refactor skip_prefix to return a boolean
  avoid using skip_prefix as a boolean
  daemon: mark some strings as const
  parse_diff_color_slot: drop ofs parameter

9 years agorefs: fix valgrind suppression file
David Turner [Fri, 4 Jul 2014 20:24:01 +0000 (13:24 -0700)] 
refs: fix valgrind suppression file

Add all of the ways in which check_refname_format violates valgrind's
expectations to the valgrind suppression file; remove an assumption about
the call chain of check_refname_format from same.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoline-log: use commit_list_append() instead of duplicating its code
René Scharfe [Tue, 8 Jul 2014 16:23:37 +0000 (18:23 +0200)] 
line-log: use commit_list_append() instead of duplicating its code

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodiff-tree: call free_commit_list() instead of duplicating its code
René Scharfe [Tue, 8 Jul 2014 16:21:05 +0000 (18:21 +0200)] 
diff-tree: call free_commit_list() instead of duplicating its code

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5000, t5003: simplify commit
René Scharfe [Sat, 5 Jul 2014 19:35:01 +0000 (21:35 +0200)] 
t5000, t5003: simplify commit

Add the whole directory of test files at once using git add instead of
calling git update-index on each of them and use git commit instead of
the plumbing commands write-tree, update-ref and commit-tree to build
the commit.  This simplifies the code considerably.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosymlinks: remove PATH_MAX limitation
Karsten Blees [Fri, 4 Jul 2014 22:41:46 +0000 (00:41 +0200)] 
symlinks: remove PATH_MAX limitation

'git checkout' fails if a directory is longer than PATH_MAX, because the
lstat_cache in symlinks.c checks if the leading directory exists using
PATH_MAX-bounded string operations.

Remove the limitation by using strbuf instead.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorefs.c: handle REFNAME_REFSPEC_PATTERN at end of page
David Turner [Sat, 5 Jul 2014 19:00:59 +0000 (12:00 -0700)] 
refs.c: handle REFNAME_REFSPEC_PATTERN at end of page

When a ref crosses a memory page boundary, we restart the parsing
at the beginning with the bytewise code.  Pass the original flags
to that code, rather than the current flags.

Reported-By: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'dt/refs-check-refname-component-sse'
Junio C Hamano [Wed, 2 Jul 2014 19:53:07 +0000 (12:53 -0700)] 
Merge branch 'dt/refs-check-refname-component-sse'

Further micro-optimization of a leaf-function.

* dt/refs-check-refname-component-sse:
  refs.c: SSE2 optimizations for check_refname_component

9 years agoMerge branch 'ye/http-extract-charset'
Junio C Hamano [Wed, 2 Jul 2014 19:53:05 +0000 (12:53 -0700)] 
Merge branch 'ye/http-extract-charset'

* ye/http-extract-charset:
  http: fix charset detection of extract_content_type()

9 years agoMerge branch 'bc/fix-rebase-merge-skip'
Junio C Hamano [Wed, 2 Jul 2014 19:53:04 +0000 (12:53 -0700)] 
Merge branch 'bc/fix-rebase-merge-skip'

"git rebase --skip" did not work well when it stopped due to a
conflict twice in a row.

* bc/fix-rebase-merge-skip:
  rebase--merge: fix --skip with two conflicts in a row

9 years agoMerge branch 'jk/commit-buffer-length'
Junio C Hamano [Wed, 2 Jul 2014 19:53:02 +0000 (12:53 -0700)] 
Merge branch 'jk/commit-buffer-length'

Move "commit->buffer" out of the in-core commit object and keep
track of their lengths.  Use this to optimize the code paths to
validate GPG signatures in commit objects.

* jk/commit-buffer-length:
  reuse cached commit buffer when parsing signatures
  commit: record buffer length in cache
  commit: convert commit->buffer to a slab
  commit-slab: provide a static initializer
  use get_commit_buffer everywhere
  convert logmsg_reencode to get_commit_buffer
  use get_commit_buffer to avoid duplicate code
  use get_cached_commit_buffer where appropriate
  provide helpers to access the commit buffer
  provide a helper to set the commit buffer
  provide a helper to free commit buffer
  sequencer: use logmsg_reencode in get_message
  logmsg_reencode: return const buffer
  do not create "struct commit" with xcalloc
  commit: push commit_index update into alloc_commit_node
  alloc: include any-object allocations in alloc_report
  replace dangerous uses of strbuf_attach
  commit_tree: take a pointer/len pair rather than a const strbuf

9 years agoenums: remove trailing ',' after last item in enum
Ronnie Sahlberg [Wed, 2 Jul 2014 18:24:05 +0000 (11:24 -0700)] 
enums: remove trailing ',' after last item in enum

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'maint'
Junio C Hamano [Wed, 2 Jul 2014 19:52:46 +0000 (12:52 -0700)] 
Merge branch 'maint'

* maint:
  t7300: repair filesystem permissions with test_when_finished
  enums: remove trailing ',' after last item in enum

9 years agoMerge branch 'maint-1.8.5' into maint
Junio C Hamano [Wed, 2 Jul 2014 19:51:50 +0000 (12:51 -0700)] 
Merge branch 'maint-1.8.5' into maint

* maint-1.8.5:
  t7300: repair filesystem permissions with test_when_finished
  enums: remove trailing ',' after last item in enum

9 years agot7300: repair filesystem permissions with test_when_finished
Jeff King [Wed, 2 Jul 2014 18:44:30 +0000 (14:44 -0400)] 
t7300: repair filesystem permissions with test_when_finished

We create a directory that cannot be removed, confirm that
it cannot be removed, and then fix it like:

  chmod 0 foo &&
  test_must_fail git clean -d -f &&
  chmod 755 foo

If the middle step fails but leaves the directory (e.g., the
bug is that clean does not notice the failure), this
pollutes the test repo with an unremovable directory. Not
only does this cause further tests to fail, but it means
that "rm -rf" fails on the whole trash directory, and the
user has to intervene manually to even re-run the test script.

We can bump the "chmod 755" recovery to a test_when_finished
block to be sure that it always runs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoenums: remove trailing ',' after last item in enum
Ronnie Sahlberg [Wed, 2 Jul 2014 18:24:05 +0000 (11:24 -0700)] 
enums: remove trailing ',' after last item in enum

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosha1_file: avoid overrunning alternate object base string
René Scharfe [Tue, 1 Jul 2014 18:00:01 +0000 (20:00 +0200)] 
sha1_file: avoid overrunning alternate object base string

While checking if a new alternate object database is a duplicate make
sure that old and new base paths have the same length before comparing
them with memcmp.  This avoids overrunning the buffer of the existing
entry if the new one is longer and it stops rejecting foobar/ after
foo/ was already added.

Signed-off-by: Rene Scharfe <ls.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowt-status: simplify building of summary limit argument
René Scharfe [Sun, 29 Jun 2014 20:55:44 +0000 (22:55 +0200)] 
wt-status: simplify building of summary limit argument

Use argv_array_pushf for building the number string for the option
--summary-limit directly instead of using an intermediate buffer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowt-status: use argv_array for environment
René Scharfe [Sun, 29 Jun 2014 20:47:00 +0000 (22:47 +0200)] 
wt-status: use argv_array for environment

Instead of using a PATH_MAX buffer, use argv_array for constructing the
environment for git submodule summary.  This simplifies the code a bit
and removes the arbitrary length limit.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge git://ozlabs.org/~paulus/gitk
Junio C Hamano [Fri, 27 Jun 2014 18:23:03 +0000 (11:23 -0700)] 
Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
  gitk: Add visiblerefs option, which lists always-shown branches
  gitk: Catch mkdtemp errors
  gitk: Use mktemp -d to avoid predictable temporary directories
  gitk: Honor TMPDIR when viewing external diffs

9 years agogitk: Add visiblerefs option, which lists always-shown branches
Max Kirillov [Tue, 24 Jun 2014 05:19:44 +0000 (08:19 +0300)] 
gitk: Add visiblerefs option, which lists always-shown branches

When many branches contain a commit, the branches used to be shown in
the form "A, B and many more", where A, B can be master of current
HEAD. But there are more which might be interesting to always know about.
For example, "origin/master".

The new option, visiblerefs, is stored in ~/.gitk. It contains a list
of references which are always shown before "and many more" if they
contain the commit. By default it is `{"master"}', which is compatible
with previous behavior.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
9 years agogitk: Catch mkdtemp errors
David Aguilar [Thu, 19 Jun 2014 02:53:14 +0000 (19:53 -0700)] 
gitk: Catch mkdtemp errors

105b5d3f ("gitk: Use mktemp -d to avoid predictable temporary
directories") introduced a dependency on mkdtemp, which is not
available on Windows.

Use the original temporary directory behavior when mkdtemp fails.
This makes the code use mkdtemp when available and gracefully
fallback to the existing behavior when it is not available.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
9 years agoMerge early parts from git://ozlabs.org/~paulus/gitk.git
Junio C Hamano [Thu, 26 Jun 2014 20:46:09 +0000 (13:46 -0700)] 
Merge early parts from git://ozlabs.org/~paulus/gitk.git

* master~2:
  gitk: Show staged submodules regardless of ignore config
  gitk: Allow displaying time zones from author and commit dates timestamps
  gitk: Switch to patch mode when searching for line origin
  gitk: Replace SHA1 entry field on keyboard paste
  l10n: Init Vietnamese translation

9 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Thu, 26 Jun 2014 20:44:11 +0000 (13:44 -0700)] 
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: tolerate major version changes when comparing the git version
  git-gui: show staged submodules regardless of ignore config

9 years agomove "%G" format test from t7510 to t6006
Jeff King [Wed, 25 Jun 2014 21:42:17 +0000 (17:42 -0400)] 
move "%G" format test from t7510 to t6006

The final test in t7510 checks that "--format" placeholders
that look similar to GPG placeholders (but that we don't
actually understand) are passed through. That test was
placed in t7510, since the other GPG placeholder tests are
there. However, it does not have a GPG prerequisite, because
it is not actually checking any signed commits.

This causes the test to erroneously fail when gpg is not
installed on a system, however. Not because we need signed
commits, but because we need _any_ commit to run "git log".
If we don't have gpg installed, t7510 doesn't create any
commits at all.

We can fix this by moving the test into t6006. This is
arguably a better place anyway, because it is where we test
most of the other placeholders (we do not test GPG
placeholders there because of the infrastructure needed to
make signed commits).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with maint
Junio C Hamano [Wed, 25 Jun 2014 19:32:58 +0000 (12:32 -0700)] 
Sync with maint

9 years agoFifth batch for 2.1
Junio C Hamano [Wed, 25 Jun 2014 19:32:23 +0000 (12:32 -0700)] 
Fifth batch for 2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jm/dedup-name-compare'
Junio C Hamano [Wed, 25 Jun 2014 19:23:57 +0000 (12:23 -0700)] 
Merge branch 'jm/dedup-name-compare'

* jm/dedup-name-compare:
  cleanup duplicate name_compare() functions
  name-hash.c: replace cache_name_compare() with memcmp(3)

9 years agoMerge branch 'ep/avoid-test-a-o'
Junio C Hamano [Wed, 25 Jun 2014 19:23:56 +0000 (12:23 -0700)] 
Merge branch 'ep/avoid-test-a-o'

Update tests and scripts to avoid "test ... -a ...", which is often
more error-prone than "test ... && test ...".

Squashed misconversion fix-up into git-submodule.sh updates.

* ep/avoid-test-a-o:
  git-submodule.sh: avoid "echo" path-like values
  git-submodule.sh: avoid "test <cond> -a/-o <cond>"
  t/test-lib-functions.sh: avoid "test <cond> -a/-o <cond>"
  t/t9814-git-p4-rename.sh: avoid "test <cond> -a/-o <cond>"
  t/t5538-push-shallow.sh: avoid "test <cond> -a/-o <cond>"
  t/t5403-post-checkout-hook.sh: avoid "test <cond> -a/-o <cond>"
  t/t5000-tar-tree.sh: avoid "test <cond> -a/-o <cond>"
  t/t4102-apply-rename.sh: avoid "test <cond> -a/-o <cond>"
  t/t0026-eol-config.sh: avoid "test <cond> -a/-o <cond>"
  t/t0025-crlf-auto.sh: avoid "test <cond> -a/-o <cond>"
  t/lib-httpd.sh: avoid "test <cond> -a/-o <cond>"
  git-rebase--interactive.sh: avoid "test <cond> -a/-o <cond>"
  git-mergetool.sh: avoid "test <cond> -a/-o <cond>"
  git-bisect.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-resolve.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-repack.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-merge.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-commit.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-clone.sh: avoid "test <cond> -a/-o <cond>"
  check_bindir: avoid "test <cond> -a/-o <cond>"

9 years agoMerge branch 'tb/unicode-7.0-display-width'
Junio C Hamano [Wed, 25 Jun 2014 19:23:54 +0000 (12:23 -0700)] 
Merge branch 'tb/unicode-7.0-display-width'

* tb/unicode-7.0-display-width:
  Update of unicode_width.h to Unicode Version 7.0

9 years agoMerge branch 'ye/doc-http-proto'
Junio C Hamano [Wed, 25 Jun 2014 19:23:52 +0000 (12:23 -0700)] 
Merge branch 'ye/doc-http-proto'

* ye/doc-http-proto:
  http-protocol.txt: Basic Auth is defined in RFC 2617, not RFC 2616

9 years agoMerge branch 'rs/blame-refactor'
Junio C Hamano [Wed, 25 Jun 2014 19:23:36 +0000 (12:23 -0700)] 
Merge branch 'rs/blame-refactor'

* rs/blame-refactor:
  blame: simplify prepare_lines()
  blame: factor out get_next_line()

9 years agoMerge branch 'pb/trim-trailing-spaces'
Junio C Hamano [Wed, 25 Jun 2014 19:23:34 +0000 (12:23 -0700)] 
Merge branch 'pb/trim-trailing-spaces'

* pb/trim-trailing-spaces:
  t0008: do not depend on 'echo' handling backslashes specially

9 years agoMerge branch 'mc/doc-submodule-sync-recurse'
Junio C Hamano [Wed, 25 Jun 2014 19:23:29 +0000 (12:23 -0700)] 
Merge branch 'mc/doc-submodule-sync-recurse'

* mc/doc-submodule-sync-recurse:
  submodule: document "sync --recursive"

9 years agoMerge branch 'sp/complete-ext-alias'
Junio C Hamano [Wed, 25 Jun 2014 19:23:27 +0000 (12:23 -0700)] 
Merge branch 'sp/complete-ext-alias'

* sp/complete-ext-alias:
  completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliases

9 years agoMerge branch 'mc/git-p4-prepare-p4-only'
Junio C Hamano [Wed, 25 Jun 2014 19:23:24 +0000 (12:23 -0700)] 
Merge branch 'mc/git-p4-prepare-p4-only'

* mc/git-p4-prepare-p4-only:
  git-p4: fix submit in non --prepare-p4-only mode

9 years agoMerge branch 'jk/repack-pack-writebitmaps-config'
Junio C Hamano [Wed, 25 Jun 2014 19:23:19 +0000 (12:23 -0700)] 
Merge branch 'jk/repack-pack-writebitmaps-config'

* jk/repack-pack-writebitmaps-config:
  t7700: drop explicit --no-pack-kept-objects from .keep test
  repack: introduce repack.writeBitmaps config option
  repack: simplify handling of --write-bitmap-index
  pack-objects: stop respecting pack.writebitmaps

9 years agoMerge branch 'nd/init-restore-env'
Junio C Hamano [Wed, 25 Jun 2014 19:22:00 +0000 (12:22 -0700)] 
Merge branch 'nd/init-restore-env'

Some subcommands do not want to be aliased because of the side
effects that happens while the definitions of the aliases are looked
up from configuration system.

* nd/init-restore-env:
  git potty: restore environments after alias expansion

9 years agoMerge branch 'jk/repack-pack-keep-objects'
Junio C Hamano [Wed, 25 Jun 2014 19:21:51 +0000 (12:21 -0700)] 
Merge branch 'jk/repack-pack-keep-objects'

Recent updates to "git repack" started to duplicate objects that
are in packfiles marked with .keep flag into the new packfile by
mistake.

* jk/repack-pack-keep-objects:
  repack: s/write_bitmap/&s/ in code
  repack: respect pack.writebitmaps
  repack: do not accidentally pack kept objects by default

9 years agoMerge branch 'fr/sequencer-fail-with-not-one-upon-no-ff'
Junio C Hamano [Wed, 25 Jun 2014 19:21:45 +0000 (12:21 -0700)] 
Merge branch 'fr/sequencer-fail-with-not-one-upon-no-ff'

* fr/sequencer-fail-with-not-one-upon-no-ff:
  sequencer: signal failed ff as an aborted, not a conflicted merge

9 years agoGit 2.0.1 v2.0.1
Junio C Hamano [Wed, 25 Jun 2014 19:21:11 +0000 (12:21 -0700)] 
Git 2.0.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'na/no-http-test-in-the-middle' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:50:13 +0000 (11:50 -0700)] 
Merge branch 'na/no-http-test-in-the-middle' into maint

The mode to run tests with HTTP server tests disabled was broken.

* na/no-http-test-in-the-middle:
  t5538: move http push tests out to t5542

9 years agoMerge branch 'jl/status-added-submodule-is-never-ignored' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:50:03 +0000 (11:50 -0700)] 
Merge branch 'jl/status-added-submodule-is-never-ignored' into maint

"git status" (and "git commit") behaved as if changes in a modified
submodule are not there if submodule.*.ignore configuration is set,
which was misleading.  The configuration is only to unclutter diff
output during the course of development, and should not to hide
changes in the "status" output to cause the users forget to commit
them.

* jl/status-added-submodule-is-never-ignored:
  commit -m: commit staged submodules regardless of ignore config
  status/commit: show staged submodules regardless of ignore config

9 years agoMerge branch 'ym/fix-opportunistic-index-update-race' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:49:48 +0000 (11:49 -0700)] 
Merge branch 'ym/fix-opportunistic-index-update-race' into maint

"git status", even though it is a read-only operation, tries to
update the index with refreshed lstat(2) info to optimize future
accesses to the working tree opportunistically, but this could
race with a "read-write" operation that modify the index while it
is running.  Detect such a race and avoid overwriting the index.

* ym/fix-opportunistic-index-update-race:
  read-cache.c: verify index file before we opportunistically update it
  wrapper.c: add xpread() similar to xread()

9 years agoMerge branch 'mk/show-s-no-extra-blank-line-for-merges' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:49:39 +0000 (11:49 -0700)] 
Merge branch 'mk/show-s-no-extra-blank-line-for-merges' into maint

"git show -s" (i.e. show log message only) used to incorrectly emit
an extra blank line after a merge commit.

* mk/show-s-no-extra-blank-line-for-merges:
  git-show: fix 'git show -s' to not add extra terminator after merge commit

9 years agoMerge branch 'rr/rebase-autostash-fix' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:49:31 +0000 (11:49 -0700)] 
Merge branch 'rr/rebase-autostash-fix' into maint

The autostash mode of "git rebase -i" did not restore the dirty
working tree state if the user aborted the interactive rebase by
emptying the insn sheet.

* rr/rebase-autostash-fix:
  rebase -i: test "Nothing to do" case with autostash
  rebase -i: handle "Nothing to do" case with autostash

9 years agoMerge branch 'jc/shortlog-ref-exclude' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:49:10 +0000 (11:49 -0700)] 
Merge branch 'jc/shortlog-ref-exclude' into maint

"git log --exclude=<glob> --all | git shortlog" worked as expected,
but "git shortlog --exclude=<glob> --all", which is supposed to be
identical to the above pipeline, was not accepted at the command
line argument parser level.

* jc/shortlog-ref-exclude:
  shortlog: allow --exclude=<glob> to be passed

9 years agoMerge branch 'jl/remote-rm-prune' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:49:01 +0000 (11:49 -0700)] 
Merge branch 'jl/remote-rm-prune' into maint

"git remote rm" and "git remote prune" can involve removing many
refs at once, which is not a very efficient thing to do when very
many refs exist in the packed-refs file.

* jl/remote-rm-prune:
  remote prune: optimize "dangling symref" check/warning
  remote: repack packed-refs once when deleting multiple refs
  remote rm: delete remote configuration as the last

9 years agoMerge branch 'fc/rerere-conflict-style' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:48:54 +0000 (11:48 -0700)] 
Merge branch 'fc/rerere-conflict-style' into maint

"git rerere forget" did not work well when merge.conflictstyle
was set to a non-default value.

* fc/rerere-conflict-style:
  rerere: fix for merge.conflictstyle

9 years agoMerge branch 'rs/pack-objects-no-unnecessary-realloc' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:48:42 +0000 (11:48 -0700)] 
Merge branch 'rs/pack-objects-no-unnecessary-realloc' into maint

"git pack-objects" unnecessarily copied the previous contents when
extending the hashtable, even though it will populate the table
from scratch anyway.

* rs/pack-objects-no-unnecessary-realloc:
  pack-objects: use free()+xcalloc() instead of xrealloc()+memset()

9 years agoMerge branch 'dt/merge-recursive-case-insensitive' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:48:34 +0000 (11:48 -0700)] 
Merge branch 'dt/merge-recursive-case-insensitive' into maint

On a case insensitive filesystem, merge-recursive incorrectly
deleted the file that is to be renamed to a name that is the same
except for case differences.

* dt/merge-recursive-case-insensitive:
  mv: allow renaming to fix case on case insensitive filesystems
  merge-recursive.c: fix case-changing merge bug

9 years agoMerge branch 'rs/mailinfo-header-cmp' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:48:23 +0000 (11:48 -0700)] 
Merge branch 'rs/mailinfo-header-cmp' into maint

"git mailinfo" used to read beyond the end of header string while
parsing an incoming e-mail message to extract the patch.

* rs/mailinfo-header-cmp:
  mailinfo: use strcmp() for string comparison

9 years agoMerge branch 'jk/index-pack-report-missing' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:48:13 +0000 (11:48 -0700)] 
Merge branch 'jk/index-pack-report-missing' into maint

The error reporting from "git index-pack" has been improved to
distinguish missing objects from type errors.

* jk/index-pack-report-missing:
  index-pack: distinguish missing objects from type errors

9 years agoMerge branch 'nd/index-pack-one-fd-per-thread' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:47:58 +0000 (11:47 -0700)] 
Merge branch 'nd/index-pack-one-fd-per-thread' into maint

We used to disable threaded "git index-pack" on platforms without
thread-safe pread(); use a different workaround for such
platforms to allow threaded "git index-pack".

* nd/index-pack-one-fd-per-thread:
  index-pack: work around thread-unsafe pread()

9 years agoMerge branch 'sk/spawn-less-case-insensitively-from-grep-O-i' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:47:49 +0000 (11:47 -0700)] 
Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i' into maint

"git grep -O" to show the lines that hit in the pager did not work
well with case insensitive search.  We now spawn "less" with its
"-I" option when it is used as the pager (which is the default).

* sk/spawn-less-case-insensitively-from-grep-O-i:
  git grep -O -i: if the pager is 'less', pass the '-I' option

9 years agoMerge branch 'nd/daemonize-gc' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:47:36 +0000 (11:47 -0700)] 
Merge branch 'nd/daemonize-gc' into maint

"git gc --auto" was recently changed to run in the background to
give control back early to the end-user sitting in front of the
terminal, but it forgot that housekeeping involving reflogs should
be done without other processes competing for accesses to the refs.

* nd/daemonize-gc:
  gc --auto: do not lock refs in the background

9 years agoMerge branch 'jk/diff-follow-must-take-one-pathspec' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:47:23 +0000 (11:47 -0700)] 
Merge branch 'jk/diff-follow-must-take-one-pathspec' into maint

"git format-patch" did not enforce the rule that the "--follow"
option from the log/diff family of commands must be used with
exactly one pathspec.

* jk/diff-follow-must-take-one-pathspec:
  move "--follow needs one pathspec" rule to diff_setup_done

9 years agoMerge branch 'jk/diff-files-assume-unchanged' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:47:09 +0000 (11:47 -0700)] 
Merge branch 'jk/diff-files-assume-unchanged' into maint

"git diff --find-copies-harder" sometimes pretended as if the mode
bits have changed for paths that are marked with assume-unchanged
bit.

* jk/diff-files-assume-unchanged:
  run_diff_files: do not look at uninitialized stat data

9 years agoMerge branch 'jk/commit-C-pick-empty' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:46:54 +0000 (11:46 -0700)] 
Merge branch 'jk/commit-C-pick-empty' into maint

"git commit --allow-empty-message -C $commit" did not work when the
commit did not have any log message.

* jk/commit-C-pick-empty:
  commit: do not complain of empty messages from -C

9 years agoMerge branch 'bc/blame-crlf-test' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:46:44 +0000 (11:46 -0700)] 
Merge branch 'bc/blame-crlf-test' into maint

"git blame" assigned the blame to the copy in the working-tree if
the repository is set to core.autocrlf=input and the file used CRLF
line endings.

* bc/blame-crlf-test:
  blame: correctly handle files regardless of autocrlf

9 years agoMerge branch 'jx/blame-align-relative-time' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:46:34 +0000 (11:46 -0700)] 
Merge branch 'jx/blame-align-relative-time' into maint

"git blame" miscounted number of columns needed to show localized
timestamps, resulting in jaggy left-side-edge of the source code
lines in its output.

* jx/blame-align-relative-time:
  blame: dynamic blame_date_width for different locales
  blame: fix broken time_buf paddings in relative timestamp

9 years agoMerge branch 'jc/apply-ignore-whitespace' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:46:23 +0000 (11:46 -0700)] 
Merge branch 'jc/apply-ignore-whitespace' into maint

"--ignore-space-change" option of "git apply" ignored the spaces
at the beginning of line too aggressively, which is inconsistent
with the option of the same name "diff" and "git diff" have.

* jc/apply-ignore-whitespace:
  apply --ignore-space-change: lines with and without leading whitespaces do not match

9 years agoMerge branch 'jk/complete-merge-pull' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:46:12 +0000 (11:46 -0700)] 
Merge branch 'jk/complete-merge-pull' into maint

The completion scripts (in contrib/) did not know about quite a few
options that are common between "git merge" and "git pull", and a
couple of options unique to "git merge".

* jk/complete-merge-pull:
  completion: add missing options for git-merge
  completion: add a note that merge options are shared

9 years agoMerge branch 'ow/config-mailmap-pathname' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:45:55 +0000 (11:45 -0700)] 
Merge branch 'ow/config-mailmap-pathname' into maint

The "mailmap.file" configuration option did not support the tilde
expansion (i.e. ~user/path and ~/path).

* ow/config-mailmap-pathname:
  config: respect '~' and '~user' in mailmap.file

9 years agoMerge branch 'as/pretty-truncate' into maint
Junio C Hamano [Wed, 25 Jun 2014 18:45:31 +0000 (11:45 -0700)] 
Merge branch 'as/pretty-truncate' into maint

The "%<(10,trunc)%s" pretty format specifier in the log family of
commands is used to truncate the string to a given length (e.g. 10
in the example) with padding to column-align the output, but did
not take into account that number of bytes and number of display
columns are different.

* as/pretty-truncate:
  pretty.c: format string with truncate respects logOutputEncoding
  t4205, t6006: add tests that fail with i18n.logOutputEncoding set
  t4205 (log-pretty-format): use `tformat` rather than `format`
  t4041, t4205, t6006, t7102: don't hardcode tested encoding value
  t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs