]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
7 years agoMerge tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui
Junio C Hamano [Thu, 20 Oct 2016 16:33:17 +0000 (09:33 -0700)] 
Merge tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui

git-gui 0.21.0

* tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui: (22 commits)
  git-gui: set version 0.21
  git-gui: Mark 'All' in remote.tcl for translation
  git-gui i18n: Updated Bulgarian translation (565,0f,0u)
  git-gui: avoid persisting modified author identity
  git-gui: handle the encoding of Git's output correctly
  git-gui: unicode file name support on windows
  git-gui: Update Russian translation
  git-gui: maintain backwards compatibility for merge syntax
  git-gui i18n: mark string in lib/error.tcl for translation
  git-gui: fix incorrect use of Tcl append command
  git-gui i18n: mark "usage:" strings for translation
  git-gui i18n: internationalize use of colon punctuation
  git-gui: ensure the file in the diff pane is in the list of selected files
  git-gui: support for $FILENAMES in tool definitions
  git-gui: fix initial git gui message encoding
  git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution
  git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`
  git-gui: fix detection of Cygwin
  Amend tab ordering and text widget border and highlighting.
  Allow keyboard control to work in the staging widgets.
  ...

7 years agogit-gui: set version 0.21 gitgui-0.21.0
Pat Thoyts [Thu, 20 Oct 2016 10:19:43 +0000 (11:19 +0100)] 
git-gui: set version 0.21

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'as/bulgarian' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:13:42 +0000 (11:13 +0100)] 
Merge branch 'as/bulgarian' into pu

7 years agogit-gui: Mark 'All' in remote.tcl for translation
Alexander Shopov [Thu, 13 Oct 2016 18:43:48 +0000 (21:43 +0300)] 
git-gui: Mark 'All' in remote.tcl for translation

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui i18n: Updated Bulgarian translation (565,0f,0u)
Alexander Shopov [Thu, 13 Oct 2016 18:43:49 +0000 (21:43 +0300)] 
git-gui i18n: Updated Bulgarian translation (565,0f,0u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'os/preserve-author' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:07:24 +0000 (11:07 +0100)] 
Merge branch 'os/preserve-author' into pu

7 years agoMerge branch 'kb/unicode' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:06:28 +0000 (11:06 +0100)] 
Merge branch 'kb/unicode' into pu

7 years agoSync with maint
Junio C Hamano [Mon, 17 Oct 2016 20:52:26 +0000 (13:52 -0700)] 
Sync with maint

* maint:
  l10n: de.po: translate 260 new messages
  l10n: de.po: fix translation of autostash
  l10n: ru.po: update Russian translation

7 years agoMerge tag 'l10n-2.10.0-rnd2.4' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Mon, 17 Oct 2016 20:27:38 +0000 (13:27 -0700)] 
Merge tag 'l10n-2.10.0-rnd2.4' of git://github.com/git-l10n/git-po into maint

l10n-2.10.0-rnd2.4

* tag 'l10n-2.10.0-rnd2.4' of git://github.com/git-l10n/git-po:
  l10n: de.po: translate 260 new messages
  l10n: de.po: fix translation of autostash
  l10n: ru.po: update Russian translation

7 years agoTenth batch for 2.11
Junio C Hamano [Mon, 17 Oct 2016 20:26:27 +0000 (13:26 -0700)] 
Tenth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'sb/submodule-config-doc-drop-path'
Junio C Hamano [Mon, 17 Oct 2016 20:25:23 +0000 (13:25 -0700)] 
Merge branch 'sb/submodule-config-doc-drop-path'

The "submodule.<name>.path" stored in .gitmodules is never copied
to .git/config and such a key in .git/config has no meaning, but
the documentation described it and submodule.<name>.url next to
each other as if both belong to .git/config.  This has been fixed.

* sb/submodule-config-doc-drop-path:
  documentation: improve submodule.<name>.{url, path} description

7 years agoMerge branch 'rs/pretty-format-color-doc-fix'
Junio C Hamano [Mon, 17 Oct 2016 20:25:23 +0000 (13:25 -0700)] 
Merge branch 'rs/pretty-format-color-doc-fix'

* rs/pretty-format-color-doc-fix:
  pretty: fix document link for color specification

7 years agoMerge branch 'js/reset-usage'
Junio C Hamano [Mon, 17 Oct 2016 20:25:22 +0000 (13:25 -0700)] 
Merge branch 'js/reset-usage'

* js/reset-usage:
  reset: fix usage

7 years agoMerge branch 'da/mergetool-diff-order'
Junio C Hamano [Mon, 17 Oct 2016 20:25:21 +0000 (13:25 -0700)] 
Merge branch 'da/mergetool-diff-order'

"git mergetool" learned to honor "-O<orderfile>" to control the
order of paths to present to the end user.

* da/mergetool-diff-order:
  mergetool: honor -O<orderfile>
  mergetool: honor diff.orderFile
  mergetool: move main program flow into a main() function
  mergetool: add copyright

7 years agoMerge branch 'rs/cocci'
Junio C Hamano [Mon, 17 Oct 2016 20:25:21 +0000 (13:25 -0700)] 
Merge branch 'rs/cocci'

Code cleanup.

* rs/cocci:
  use strbuf_add_unique_abbrev() for adding short hashes, part 3
  remove unnecessary NULL check before free(3)

7 years agoMerge branch 'js/regexec-buf'
Junio C Hamano [Mon, 17 Oct 2016 20:25:21 +0000 (13:25 -0700)] 
Merge branch 'js/regexec-buf'

* js/regexec-buf:
  configure.ac: improve description of NO_REGEX test

7 years agoMerge branch 'jk/ref-symlink-loop'
Junio C Hamano [Mon, 17 Oct 2016 20:25:20 +0000 (13:25 -0700)] 
Merge branch 'jk/ref-symlink-loop'

A stray symbolic link in $GIT_DIR/refs/ directory could make name
resolution loop forever, which has been corrected.

* jk/ref-symlink-loop:
  files_read_raw_ref: prevent infinite retry loops in general
  files_read_raw_ref: avoid infinite loop on broken symlinks

7 years agoMerge branch 'jk/quarantine-received-objects'
Junio C Hamano [Mon, 17 Oct 2016 20:25:20 +0000 (13:25 -0700)] 
Merge branch 'jk/quarantine-received-objects'

In order for the receiving end of "git push" to inspect the
received history and decide to reject the push, the objects sent
from the sending end need to be made available to the hook and
the mechanism for the connectivity check, and this was done
traditionally by storing the objects in the receiving repository
and letting "git gc" to expire it.  Instead, store the newly
received objects in a temporary area, and make them available by
reusing the alternate object store mechanism to them only while we
decide if we accept the check, and once we decide, either migrate
them to the repository or purge them immediately.

* jk/quarantine-received-objects:
  tmp-objdir: do not migrate files starting with '.'
  tmp-objdir: put quarantine information in the environment
  receive-pack: quarantine objects until pre-receive accepts
  tmp-objdir: introduce API for temporary object directories
  check_connected: accept an env argument

7 years agoMerge branch 'jk/alt-odb-cleanup'
Junio C Hamano [Mon, 17 Oct 2016 20:25:19 +0000 (13:25 -0700)] 
Merge branch 'jk/alt-odb-cleanup'

Codepaths involved in interacting alternate object store have
been cleaned up.

* jk/alt-odb-cleanup:
  alternates: use fspathcmp to detect duplicates
  sha1_file: always allow relative paths to alternates
  count-objects: report alternates via verbose mode
  fill_sha1_file: write into a strbuf
  alternates: store scratch buffer as strbuf
  fill_sha1_file: write "boring" characters
  alternates: use a separate scratch space
  alternates: encapsulate alt->base munging
  alternates: provide helper for allocating alternate
  alternates: provide helper for adding to alternates list
  link_alt_odb_entry: refactor string handling
  link_alt_odb_entry: handle normalize_path errors
  t5613: clarify "too deep" recursion tests
  t5613: do not chdir in main process
  t5613: whitespace/style cleanups
  t5613: use test_must_fail
  t5613: drop test_valid_repo function
  t5613: drop reachable_via function

7 years agoMerge branch 'nd/commit-p-doc'
Junio C Hamano [Mon, 17 Oct 2016 20:25:19 +0000 (13:25 -0700)] 
Merge branch 'nd/commit-p-doc'

Documentation for "git commit" was updated to clarify that "commit
-p <paths>" adds to the current contents of the index to come up
with what to commit.

* nd/commit-p-doc:
  git-commit.txt: clarify --patch mode with pathspec

7 years agoMerge branch 'jk/clone-copy-alternates-fix'
Junio C Hamano [Mon, 17 Oct 2016 20:25:18 +0000 (13:25 -0700)] 
Merge branch 'jk/clone-copy-alternates-fix'

"git clone" of a local repository can be done at the filesystem
level, but the codepath did not check errors while copying and
adjusting the file that lists alternate object stores.

* jk/clone-copy-alternates-fix:
  clone: detect errors in normalize_path_copy

7 years agoMerge branch 'dt/http-empty-auth'
Junio C Hamano [Mon, 17 Oct 2016 20:25:18 +0000 (13:25 -0700)] 
Merge branch 'dt/http-empty-auth'

http.emptyauth configuration is a way to allow an empty username to
pass when attempting to authenticate using mechanisms like
Kerberos.  We took an unspecified (NULL) username and sent ":"
(i.e. no username, no password) to CURLOPT_USERPWD, but did not do
the same when the username is explicitly set to an empty string.

* dt/http-empty-auth:
  http: http.emptyauth should allow empty (not just NULL) usernames

7 years agoMerge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru
Jiang Xin [Sun, 16 Oct 2016 12:11:41 +0000 (20:11 +0800)] 
Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru

* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
  l10n: ru.po: update Russian translation

7 years agol10n: de.po: translate 260 new messages
Ralf Thielow [Wed, 12 Oct 2016 16:31:13 +0000 (18:31 +0200)] 
l10n: de.po: translate 260 new messages

Translate 260 new message came from git.pot updates in 9fa976f (l10n:
git.pot: v2.10.0 round 1 (248 new, 56 removed)) and 5bd166d (l10n:
git.pot: v2.10.0 round 2 (12 new, 44 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
7 years agoSync with maint
Junio C Hamano [Tue, 11 Oct 2016 21:55:48 +0000 (14:55 -0700)] 
Sync with maint

* maint:
  Start preparing for 2.10.2

7 years agoStart preparing for 2.10.2
Junio C Hamano [Tue, 11 Oct 2016 21:24:02 +0000 (14:24 -0700)] 
Start preparing for 2.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/verify-packfile-gently' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:35 +0000 (14:21 -0700)] 
Merge branch 'jk/verify-packfile-gently' into maint

A low-level function verify_packfile() was meant to show errors
that were detected without dying itself, but under some conditions
it didn't and died instead, which has been fixed.

* jk/verify-packfile-gently:
  verify_packfile: check pack validity before accessing data

7 years agoMerge branch 'jc/worktree-config' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:17 +0000 (14:21 -0700)] 
Merge branch 'jc/worktree-config' into maint

"git worktree", even though it used the default_abbrev setting that
ought to be affected by core.abbrev configuration variable, ignored
the variable setting.  The command has been taught to read the
default set of configuration variables to correct this.

* jc/worktree-config:
  worktree: honor configuration variables

7 years agoMerge branch 'jc/verify-loose-object-header' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:21:03 +0000 (14:21 -0700)] 
Merge branch 'jc/verify-loose-object-header' into maint

Codepaths that read from an on-disk loose object were too loose in
validating what they are reading is a proper object file and
sometimes read past the data they read from the disk, which has
been corrected.  H/t to Gustavo Grieco for reporting.

* jc/verify-loose-object-header:
  unpack_sha1_header(): detect malformed object header
  streaming: make sure to notice corrupt object

7 years agoMerge branch 'rs/git-gui-use-modern-git-merge-syntax' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:37 +0000 (14:20 -0700)] 
Merge branch 'rs/git-gui-use-modern-git-merge-syntax' into maint

The original command line syntax for "git merge", which was "git
merge <msg> HEAD <parent>...", has been deprecated for quite some
time, and "git gui" was the last in-tree user of the syntax.  This
is finally fixed, so that we can move forward with the deprecation.

* rs/git-gui-use-modern-git-merge-syntax:
  git-gui: stop using deprecated merge syntax

7 years agoMerge branch 'kd/mailinfo-quoted-string' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:31 +0000 (14:20 -0700)] 
Merge branch 'kd/mailinfo-quoted-string' into maint

An author name, that spelled a backslash-quoted double quote in the
human readable part "My \"double quoted\" name", was not unquoted
correctly while applying a patch from a piece of e-mail.

* kd/mailinfo-quoted-string:
  mailinfo: unescape quoted-pair in header fields
  t5100-mailinfo: replace common path prefix with variable

7 years agoMerge branch 'pb/rev-list-reverse-with-count' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:20:05 +0000 (14:20 -0700)] 
Merge branch 'pb/rev-list-reverse-with-count' into maint

Doc update to clarify what "log -3 --reverse" does.

* pb/rev-list-reverse-with-count:
  rev-list-options: clarify the usage of --reverse

7 years agoMerge branch 'jc/blame-abbrev' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:19:52 +0000 (14:19 -0700)] 
Merge branch 'jc/blame-abbrev' into maint

Almost everybody uses DEFAULT_ABBREV to refer to the default
setting for the abbreviation, but "git blame" peeked into
underlying variable bypassing the macro for no good reason.

* jc/blame-abbrev:
  blame: use DEFAULT_ABBREV macro

7 years agoMerge branch 'jk/graph-padding-fix' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:19:03 +0000 (14:19 -0700)] 
Merge branch 'jk/graph-padding-fix' into maint

The "graph" API used in "git log --graph" miscounted the number of
output columns consumed so far when drawing a padding line, which
has been fixed; this did not affect any existing code as nobody
tried to write anything after the padding on such a line, though.

* jk/graph-padding-fix:
  graph: fix extra spaces in graph_padding_line

7 years agoMerge branch 'sg/ref-filter-parse-optim' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:18:57 +0000 (14:18 -0700)] 
Merge branch 'sg/ref-filter-parse-optim' into maint

The code that parses the format parameter of for-each-ref command
has seen a micro-optimization.

* sg/ref-filter-parse-optim:
  ref-filter: strip format option after a field name only once while parsing

7 years agoMerge branch 'rs/copy-array' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:18:32 +0000 (14:18 -0700)] 
Merge branch 'rs/copy-array' into maint

Code cleanup.

* rs/copy-array:
  use COPY_ARRAY
  add COPY_ARRAY

7 years agoMerge branch 'dt/mailinfo' into maint
Junio C Hamano [Tue, 11 Oct 2016 21:17:52 +0000 (14:17 -0700)] 
Merge branch 'dt/mailinfo' into maint

* dt/mailinfo:
  add David Turner's Two Sigma address

7 years agoreset: fix usage
Johannes Schindelin [Tue, 11 Oct 2016 16:09:03 +0000 (18:09 +0200)] 
reset: fix usage

The <tree-ish> parameter is actually optional (see man page).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agopretty: fix document link for color specification
René Scharfe [Tue, 11 Oct 2016 03:41:14 +0000 (05:41 +0200)] 
pretty: fix document link for color specification

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomergetool: honor -O<orderfile>
David Aguilar [Sat, 8 Oct 2016 00:01:30 +0000 (17:01 -0700)] 
mergetool: honor -O<orderfile>

Teach mergetool to pass "-O<orderfile>" down to `git diff` when
specified on the command-line.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomergetool: honor diff.orderFile
David Aguilar [Fri, 7 Oct 2016 23:58:05 +0000 (16:58 -0700)] 
mergetool: honor diff.orderFile

Teach mergetool to get the list of files to edit via `diff` so that we
gain support for diff.orderFile.

Suggested-by: Luis Gutierrez <luisgutz@gmail.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomergetool: move main program flow into a main() function
David Aguilar [Fri, 7 Oct 2016 23:58:04 +0000 (16:58 -0700)] 
mergetool: move main program flow into a main() function

Make it easier to follow the program's flow by isolating all
logic into functions.  Isolate the main execution code path into
a single unit instead of having prompt_after_failed_merge()
interrupt it partyway through.

The use of a main() function is borrowing a convention from C,
Python, Perl, and many other languages.  This helps readers more
familiar with other languages understand the purpose of each
function when diving into the codebase with fresh eyes.

Signed-off-by: David Aguilar <davvid@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomergetool: add copyright
David Aguilar [Fri, 7 Oct 2016 23:58:03 +0000 (16:58 -0700)] 
mergetool: add copyright

Signed-off-by: David Aguilar <davvid@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agodocumentation: improve submodule.<name>.{url, path} description
Stefan Beller [Mon, 10 Oct 2016 19:36:41 +0000 (12:36 -0700)] 
documentation: improve submodule.<name>.{url, path} description

Unlike the url variable a user cannot override the the path variable,
as it is part of the content together with the gitlink at the given
path. To avoid confusion do not mention the .path variable in the config
section and rely on the documentation provided in gitmodules[5].

Enhance the description of submodule.<name>.url and mention its two use
cases separately.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoconfigure.ac: improve description of NO_REGEX test
Jakub Narębski [Fri, 7 Oct 2016 11:30:52 +0000 (13:30 +0200)] 
configure.ac: improve description of NO_REGEX test

The commit 2f8952250a ("regex: add regexec_buf() that can work on a
non NUL-terminated string", 2016-09-21) changed description of
NO_REGEX build config variable to be more neutral, and actually say
that it is about support for REG_STARTEND.  Change description in
configure.ac to match.

Change also the test message and variable name to match.  The test
just checks that REG_STARTEND is #defined.

Issue-found-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoNinth batch for 2.11
Junio C Hamano [Mon, 10 Oct 2016 21:09:12 +0000 (14:09 -0700)] 
Ninth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jc/blame-reverse'
Junio C Hamano [Mon, 10 Oct 2016 21:03:51 +0000 (14:03 -0700)] 
Merge branch 'jc/blame-reverse'

It is a common mistake to say "git blame --reverse OLD path",
expecting that the command line is dwimmed as if asking how lines
in path in an old revision OLD have survived up to the current
commit.

* jc/blame-reverse:
  blame: dwim "blame --reverse OLD" as "blame --reverse OLD.."
  blame: improve diagnosis for "--reverse NEW"

7 years agoMerge branch 'nd/shallow-deepen'
Junio C Hamano [Mon, 10 Oct 2016 21:03:50 +0000 (14:03 -0700)] 
Merge branch 'nd/shallow-deepen'

The existing "git fetch --depth=<n>" option was hard to use
correctly when making the history of an existing shallow clone
deeper.  A new option, "--deepen=<n>", has been added to make this
easier to use.  "git clone" also learned "--shallow-since=<date>"
and "--shallow-exclude=<tag>" options to make it easier to specify
"I am interested only in the recent N months worth of history" and
"Give me only the history since that version".

* nd/shallow-deepen: (27 commits)
  fetch, upload-pack: --deepen=N extends shallow boundary by N commits
  upload-pack: add get_reachable_list()
  upload-pack: split check_unreachable() in two, prep for get_reachable_list()
  t5500, t5539: tests for shallow depth excluding a ref
  clone: define shallow clone boundary with --shallow-exclude
  fetch: define shallow boundary with --shallow-exclude
  upload-pack: support define shallow boundary by excluding revisions
  refs: add expand_ref()
  t5500, t5539: tests for shallow depth since a specific date
  clone: define shallow clone boundary based on time with --shallow-since
  fetch: define shallow boundary with --shallow-since
  upload-pack: add deepen-since to cut shallow repos based on time
  shallow.c: implement a generic shallow boundary finder based on rev-list
  fetch-pack: use a separate flag for fetch in deepening mode
  fetch-pack.c: mark strings for translating
  fetch-pack: use a common function for verbose printing
  fetch-pack: use skip_prefix() instead of starts_with()
  upload-pack: move rev-list code out of check_non_tip()
  upload-pack: make check_non_tip() clean things up on error
  upload-pack: tighten number parsing at "deepen" lines
  ...

7 years agoMerge branch 'cp/completion-negative-refs'
Junio C Hamano [Mon, 10 Oct 2016 21:03:49 +0000 (14:03 -0700)] 
Merge branch 'cp/completion-negative-refs'

The command-line completion script (in contrib/) learned to
complete "git cmd ^mas<HT>" to complete the negative end of
reference to "git cmd ^master".

* cp/completion-negative-refs:
  completion: support excluding refs

7 years agoMerge branch 'dp/autoconf-curl-ssl'
Junio C Hamano [Mon, 10 Oct 2016 21:03:48 +0000 (14:03 -0700)] 
Merge branch 'dp/autoconf-curl-ssl'

The ./configure script generated from configure.ac was taught how
to detect support of SSL by libcurl better.

* dp/autoconf-curl-ssl:
  ./configure.ac: detect SSL in libcurl using curl-config

7 years agoMerge branch 'ak/curl-imap-send-explicit-scheme'
Junio C Hamano [Mon, 10 Oct 2016 21:03:47 +0000 (14:03 -0700)] 
Merge branch 'ak/curl-imap-send-explicit-scheme'

When we started cURL to talk to imap server when a new enough
version of cURL library is available, we forgot to explicitly add
imap(s):// before the destination.  To some folks, that didn't work
and the library tried to make HTTP(s) requests instead.

* ak/curl-imap-send-explicit-scheme:
  imap-send: Tell cURL to use imap:// or imaps://

7 years agoMerge branch 'jk/pack-objects-optim-mru'
Junio C Hamano [Mon, 10 Oct 2016 21:03:46 +0000 (14:03 -0700)] 
Merge branch 'jk/pack-objects-optim-mru'

"git pack-objects" in a repository with many packfiles used to
spend a lot of time looking for/at objects in them; the accesses to
the packfiles are now optimized by checking the most-recently-used
packfile first.

* jk/pack-objects-optim-mru:
  pack-objects: use mru list when iterating over packs
  pack-objects: break delta cycles before delta-search phase
  sha1_file: make packed_object_info public
  provide an initializer for "struct object_info"

7 years agoMerge branch 'rs/qsort'
Junio C Hamano [Mon, 10 Oct 2016 21:03:46 +0000 (14:03 -0700)] 
Merge branch 'rs/qsort'

We call "qsort(array, nelem, sizeof(array[0]), fn)", and most of
the time third parameter is redundant.  A new QSORT() macro lets us
omit it.

* rs/qsort:
  show-branch: use QSORT
  use QSORT, part 2
  coccicheck: use --all-includes by default
  remove unnecessary check before QSORT
  use QSORT
  add QSORT

7 years agotmp-objdir: do not migrate files starting with '.'
Jeff King [Mon, 3 Oct 2016 20:49:22 +0000 (16:49 -0400)] 
tmp-objdir: do not migrate files starting with '.'

This avoids "." and "..", as we already do, but also leaves
room for index-pack to store extra data in the quarantine
area (e.g., for passing back any analysis to be read by the
pre-receive hook).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotmp-objdir: put quarantine information in the environment
Jeff King [Mon, 3 Oct 2016 20:49:18 +0000 (16:49 -0400)] 
tmp-objdir: put quarantine information in the environment

The presence of the GIT_QUARANTINE_PATH variable lets any
called programs know that they're operating in a temporary
object directory (and where that directory is).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoreceive-pack: quarantine objects until pre-receive accepts
Jeff King [Mon, 3 Oct 2016 20:49:14 +0000 (16:49 -0400)] 
receive-pack: quarantine objects until pre-receive accepts

When a client pushes objects to us, index-pack checks the
objects themselves and then installs them into place. If we
then reject the push due to a pre-receive hook, we cannot
just delete the packfile; other processes may be depending
on it. We have to do a normal reachability check at this
point via `git gc`.

But such objects may hang around for weeks due to the
gc.pruneExpire grace period. And worse, during that time
they may be exploded from the pack into inefficient loose
objects.

Instead, this patch teaches receive-pack to put the new
objects into a "quarantine" temporary directory. We make
these objects available to the connectivity check and to the
pre-receive hook, and then install them into place only if
it is successful (and otherwise remove them as tempfiles).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotmp-objdir: introduce API for temporary object directories
Jeff King [Mon, 3 Oct 2016 20:49:11 +0000 (16:49 -0400)] 
tmp-objdir: introduce API for temporary object directories

Once objects are added to the object database by a process,
they cannot easily be deleted, as we don't know what other
processes may have started referencing them. We have to
clean them up with git-gc, which will apply the usual
reachability and grace-period checks.

This patch provides an alternative: it helps callers create
a temporary directory inside the object directory, and a
temporary environment which can be passed to sub-programs to
ask them to write there (the original object directory
remains accessible as an alternate of the temporary one).

See tmp-objdir.h for details on the API.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agocheck_connected: accept an env argument
Jeff King [Mon, 3 Oct 2016 20:49:08 +0000 (16:49 -0400)] 
check_connected: accept an env argument

This lets callers influence the environment seen by
rev-list, which will be useful when we start providing
quarantined objects.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: use fspathcmp to detect duplicates
Jeff King [Mon, 3 Oct 2016 20:36:26 +0000 (16:36 -0400)] 
alternates: use fspathcmp to detect duplicates

On a case-insensitive filesystem, we should realize that
"a/objects" and "A/objects" are the same path. We already
use fspathcmp() to check against the main object directory,
but until recently we couldn't use it for comparing against
other alternates (because their paths were not
NUL-terminated strings). But now we can, so let's do so.

Note that we also need to adjust count-objects to load the
config, so that it can see the setting of core.ignorecase
(this is required by the test, but is also a general bugfix
for users of count-objects).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agosha1_file: always allow relative paths to alternates
Jeff King [Mon, 3 Oct 2016 20:36:22 +0000 (16:36 -0400)] 
sha1_file: always allow relative paths to alternates

We recursively expand alternates repositories, so that if A
borrows from B which borrows from C, A can see all objects.

For the root object database, we allow relative paths, so A
can point to B as "../B/objects". However, we currently do
not allow relative paths when recursing, so B must use an
absolute path to reach C.

That is an ancient protection from c2f493a (Transitively
read alternatives, 2006-05-07) that tries to avoid adding
the same alternate through two different paths. Since
5bdf0a8 (sha1_file: normalize alt_odb path before comparing
and storing, 2011-09-07), we use a normalized absolute path
for each alt_odb entry.

This means that in most cases the protection is no longer
necessary; we will detect the duplicate no matter how we got
there (but see below).  And it's a good idea to get rid of
it, as it creates an unnecessary complication when setting
up recursive alternates (B has to know that A is going to
borrow from it and make sure to use an absolute path).

Note that our normalization doesn't actually look at the
filesystem, so it can still be fooled by crossing symbolic
links. But that's also true of absolute paths, so it's not a
good reason to disallow only relative paths (it's
potentially a reason to switch to real_path(), but that's a
separate and non-trivial change).

We adjust the test script here to demonstrate that this now
works, and add new tests to show that the normalization does
indeed suppress duplicates.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agocount-objects: report alternates via verbose mode
Jeff King [Mon, 3 Oct 2016 20:36:18 +0000 (16:36 -0400)] 
count-objects: report alternates via verbose mode

There's no way to get the list of alternates that git
computes internally; our tests only infer it based on which
objects are available. In addition to testing, knowing this
list may be helpful for somebody debugging their alternates
setup.

Let's add it to the "count-objects -v" output. We could give
it a separate flag, but there's not really any need.
"count-objects -v" is already a debugging catch-all for the
object database, its output is easily extensible to new data
items, and printing the alternates is not expensive (we
already had to find them to count the objects).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofill_sha1_file: write into a strbuf
Jeff King [Mon, 3 Oct 2016 20:36:09 +0000 (16:36 -0400)] 
fill_sha1_file: write into a strbuf

It's currently the responsibility of the caller to give
fill_sha1_file() enough bytes to write into, leading them to
manually compute the required lengths. Instead, let's just
write into a strbuf so that it's impossible to get this
wrong.

The alt_odb caller already has a strbuf, so this makes
things strictly simpler. The other caller, sha1_file_name(),
uses a static PATH_MAX buffer and dies when it would
overflow. We can convert this to a static strbuf, which
means our allocation cost is amortized (and as a bonus, we
no longer have to worry about PATH_MAX being too short for
normal use).

This does introduce some small overhead in fill_sha1_file(),
as each strbuf_addchar() will check whether it needs to
grow. However, between the optimization in fec501d
(strbuf_addch: avoid calling strbuf_grow, 2015-04-16) and
the fact that this is not generally called in a tight loop
(after all, the next step is typically to access the file!)
this probably doesn't matter. And even if it did, the right
place to micro-optimize is inside fill_sha1_file(), by
calling a single strbuf_grow() there.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: store scratch buffer as strbuf
Jeff King [Mon, 3 Oct 2016 20:36:04 +0000 (16:36 -0400)] 
alternates: store scratch buffer as strbuf

We pre-size the scratch buffer to hold a loose object
filename of the form "xx/yyyy...", which leads to allocation
code that is hard to verify. We have to use some magic
numbers during the initial allocation, and then writers must
blindly assume that the buffer is big enough. Using a strbuf
makes it more clear that we cannot overflow.

Unfortunately, we do still need some magic numbers to grow
our strbuf before calling fill_sha1_path(), but the strbuf
growth is much closer to the point of use. This makes it
easier to see that it's correct, and opens the possibility
of pushing it even further down if fill_sha1_path() learns
to work on strbufs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofill_sha1_file: write "boring" characters
Jeff King [Mon, 3 Oct 2016 20:35:55 +0000 (16:35 -0400)] 
fill_sha1_file: write "boring" characters

This function forms a sha1 as "xx/yyyy...", but skips over
the slot for the slash rather than writing it, leaving it to
the caller to do so. It also does not bother to put in a
trailing NUL, even though every caller would want it (we're
forming a path which by definition is not a directory, so
the only thing to do with it is feed it to a system call).

Let's make the lives of our callers easier by just writing
out the internal "/" and the NUL.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: use a separate scratch space
Jeff King [Mon, 3 Oct 2016 20:35:51 +0000 (16:35 -0400)] 
alternates: use a separate scratch space

The alternate_object_database struct uses a single buffer
both for storing the path to the alternate, and as a scratch
buffer for forming object names. This is efficient (since
otherwise we'd end up storing the path twice), but it makes
life hard for callers who just want to know the path to the
alternate. They have to remember to stop reading after
"alt->name - alt->base" bytes, and to subtract one for the
trailing '/'.

It would be much simpler if they could simply access a
NUL-terminated path string. We could encapsulate this in a
function which puts a NUL in the scratch buffer and returns
the string, but that opens up questions about the lifetime
of the result. The first time another caller uses the
alternate, the scratch buffer may get other data tacked onto
it.

Let's instead just store the root path separately from the
scratch buffer. There aren't enough alternates being stored
for the duplicated data to matter for performance, and this
keeps things simple and safe for the callers.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: encapsulate alt->base munging
Jeff King [Mon, 3 Oct 2016 20:35:43 +0000 (16:35 -0400)] 
alternates: encapsulate alt->base munging

The alternate_object_database struct holds a path to the
alternate objects, but we also use that buffer as scratch
space for forming loose object filenames. Let's pull that
logic into a helper function so that we can more easily
modify it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: provide helper for allocating alternate
Jeff King [Mon, 3 Oct 2016 20:35:31 +0000 (16:35 -0400)] 
alternates: provide helper for allocating alternate

Allocating a struct alternate_object_database is tricky, as
we must over-allocate the buffer to provide scratch space,
and then put in particular '/' and NUL markers.

Let's encapsulate this in a function so that the complexity
doesn't leak into callers (and so that we can modify it
later).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: provide helper for adding to alternates list
Jeff King [Mon, 3 Oct 2016 20:35:03 +0000 (16:35 -0400)] 
alternates: provide helper for adding to alternates list

The submodule code wants to temporarily add an alternate
object store to our in-memory alt_odb list, but does it
manually. Let's provide a helper so it can reuse the code in
link_alt_odb_entry().

While we're adding our new add_to_alternates_memory(), let's
document add_to_alternates_file(), as the two are related.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agolink_alt_odb_entry: refactor string handling
Jeff King [Mon, 3 Oct 2016 20:34:48 +0000 (16:34 -0400)] 
link_alt_odb_entry: refactor string handling

The string handling in link_alt_odb_entry() is mostly an
artifact of the original version, which took the path as a
ptr/len combo, and did not have a NUL-terminated string
until we created one in the alternate_object_database
struct.  But since 5bdf0a8 (sha1_file: normalize alt_odb
path before comparing and storing, 2011-09-07), the first
thing we do is put the path into a strbuf, which gives us
some easy opportunities for cleanup.

In particular:

  - we call strlen(pathbuf.buf), which is silly; we can look
    at pathbuf.len.

  - even though we have a strbuf, we don't maintain its
    "len" field when chomping extra slashes from the
    end, and instead keep a separate "pfxlen" variable. We
    can fix this and then drop "pfxlen" entirely.

  - we don't check whether the path is usable until after we
    allocate the new struct, making extra cleanup work for
    ourselves. Since we have a NUL-terminated string, we can
    bump the "is it usable" checks higher in the function.
    While we're at it, we can move that logic to its own
    helper, which makes the flow of link_alt_odb_entry()
    easier to follow.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agolink_alt_odb_entry: handle normalize_path errors
Jeff King [Mon, 3 Oct 2016 20:34:17 +0000 (16:34 -0400)] 
link_alt_odb_entry: handle normalize_path errors

When we add a new alternate to the list, we try to normalize
out any redundant "..", etc. However, we do not look at the
return value of normalize_path_copy(), and will happily
continue with a path that could not be normalized. Worse,
the normalizing process is done in-place, so we are left
with whatever half-finished working state the normalizing
function was in.

Fortunately, this cannot cause us to read past the end of
our buffer, as that working state will always leave the
NUL from the original path in place. And we do tend to
notice problems when we check is_directory() on the path.
But you can see the nonsense that we feed to is_directory
with an entry like:

  this/../../is/../../way/../../too/../../deep/../../to/../../resolve

in your objects/info/alternates, which yields:

  error: object directory
  /to/e/deep/too/way//ects/this/../../is/../../way/../../too/../../deep/../../to/../../resolve
  does not exist; check .git/objects/info/alternates.

We can easily fix this just by checking the return value.
But that makes it hard to generate a good error message,
since we're normalizing in-place and our input value has
been overwritten by cruft.

Instead, let's provide a strbuf helper that does an in-place
normalize, but restores the original contents on error. This
uses a second buffer under the hood, which is slightly less
efficient, but this is not a performance-critical code path.

The strbuf helper can also properly set the "len" parameter
of the strbuf before returning. Just doing:

  normalize_path_copy(buf.buf, buf.buf);

will shorten the string, but leave buf.len at the original
length. That may be confusing to later code which uses the
strbuf.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot5613: clarify "too deep" recursion tests
Jeff King [Mon, 3 Oct 2016 20:34:12 +0000 (16:34 -0400)] 
t5613: clarify "too deep" recursion tests

These tests are just trying to show that we allow recursion
up to a certain depth, but not past it. But the counting is
a bit non-intuitive, and rather than test at the edge of the
breakage, we test "OK" cases in the middle of the chain.
Let's explain what's going on, and explicitly test the
switch between "OK" and "too deep".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agouse strbuf_add_unique_abbrev() for adding short hashes, part 3
René Scharfe [Sat, 8 Oct 2016 15:38:47 +0000 (17:38 +0200)] 
use strbuf_add_unique_abbrev() for adding short hashes, part 3

Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs
instead of taking detours through find_unique_abbrev() and its static
buffer.  This is shorter in most cases and a bit more efficient.

The changes here are not easily handled by a semantic patch because
they involve removing temporary variables and deconstructing format
strings for strbuf_addf().

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoremove unnecessary NULL check before free(3)
René Scharfe [Sat, 8 Oct 2016 14:14:57 +0000 (16:14 +0200)] 
remove unnecessary NULL check before free(3)

free(3) handles NULL pointers just fine.  Add a semantic patch for
removing unnecessary NULL checks before calling this function, and
apply it on the code base.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofiles_read_raw_ref: prevent infinite retry loops in general
Jeff King [Thu, 6 Oct 2016 16:48:42 +0000 (12:48 -0400)] 
files_read_raw_ref: prevent infinite retry loops in general

Limit the number of retries to 3. That should be adequate to
prevent any races, while preventing the possibility of
infinite loops if the logic fails to handle any other
possible error modes correctly.

After the fix in the previous commit, there's no known way
to trigger an infinite loop, but I did manually verify that
this fixes the test in that commit even when the code change
is not applied.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofiles_read_raw_ref: avoid infinite loop on broken symlinks
Jeff King [Thu, 6 Oct 2016 19:41:08 +0000 (15:41 -0400)] 
files_read_raw_ref: avoid infinite loop on broken symlinks

Our ref resolution first runs lstat() on any path we try to
look up, because we want to treat symlinks specially (by
resolving them manually and considering them symrefs). But
if the results of `readlink` do _not_ look like a ref, we
fall through to treating it like a normal file, and just
read the contents of the linked path.

Since fcb7c76 (resolve_ref_unsafe(): close race condition
reading loose refs, 2013-06-19), that "normal file" code
path will stat() the file and if we see ENOENT, will jump
back to the lstat(), thinking we've seen inconsistent
results between the two calls. But for a symbolic ref, this
isn't a race: the lstat() found the symlink, and the stat()
is looking at the path it points to. We end up in an
infinite loop calling lstat() and stat().

We can fix this by avoiding the retry-on-inconsistent jump
when we know that we found a symlink. While we're at it,
let's add a comment explaining why the symlink case gets to
this code in the first place; without that, it is not
obvious that the correct solution isn't to avoid the stat()
code path entirely.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoEighth batch for 2.11
Junio C Hamano [Thu, 6 Oct 2016 21:55:18 +0000 (14:55 -0700)] 
Eighth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'sg/ref-filter-parse-optim'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'sg/ref-filter-parse-optim'

The code that parses the format parameter of for-each-ref command
has seen a micro-optimization.

* sg/ref-filter-parse-optim:
  ref-filter: strip format option after a field name only once while parsing

7 years agoMerge branch 'rs/cocci'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'rs/cocci'

Code clean-up with help from coccinelle tool continues.

* rs/cocci:
  coccicheck: make transformation for strbuf_addf(sb, "...") more precise
  use strbuf_add_unique_abbrev() for adding short hashes, part 2
  use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
  gitignore: ignore output files of coccicheck make target

7 years agoMerge branch 'rs/c-auto-resets-attributes'
Junio C Hamano [Thu, 6 Oct 2016 21:53:12 +0000 (14:53 -0700)] 
Merge branch 'rs/c-auto-resets-attributes'

When "%C(auto)" appears at the very beginning of the pretty format
string, it did not need to issue the reset sequence, but it did.

* rs/c-auto-resets-attributes:
  pretty: avoid adding reset for %C(auto) if output is empty

7 years agoMerge branch 'ps/http-gssapi-cred-delegation'
Junio C Hamano [Thu, 6 Oct 2016 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'ps/http-gssapi-cred-delegation'

In recent versions of cURL, GSSAPI credential delegation is
disabled by default due to CVE-2011-2192; introduce a configuration
to selectively allow enabling this.

* ps/http-gssapi-cred-delegation:
  http: control GSSAPI credential delegation

7 years agoMerge branch 'jk/graph-padding-fix'
Junio C Hamano [Thu, 6 Oct 2016 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'jk/graph-padding-fix'

The "graph" API used in "git log --graph" miscounted the number of
output columns consumed so far when drawing a padding line, which
has been fixed; this did not affect any existing code as nobody
tried to write anything after the padding on such a line, though.

* jk/graph-padding-fix:
  graph: fix extra spaces in graph_padding_line

7 years agoMerge branch 'jc/blame-abbrev'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'jc/blame-abbrev'

Almost everybody uses DEFAULT_ABBREV to refer to the default
setting for the abbreviation, but "git blame" peeked into
underlying variable bypassing the macro for no good reason.

* jc/blame-abbrev:
  blame: use DEFAULT_ABBREV macro

7 years agoMerge branch 'vn/revision-shorthand-for-side-branch-log'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'vn/revision-shorthand-for-side-branch-log'

"git log rev^..rev" is an often-used revision range specification
to show what was done on a side branch merged at rev.  This has
gained a short-hand "rev^-1".  In general "rev^-$n" is the same as
"^rev^$n rev", i.e. what has happened on other branches while the
history leading to nth parent was looking the other way.

* vn/revision-shorthand-for-side-branch-log:
  revision: new rev^-n shorthand for rev^n..rev

7 years agoMerge branch 'jk/ambiguous-short-object-names'
Junio C Hamano [Thu, 6 Oct 2016 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'jk/ambiguous-short-object-names'

When given an abbreviated object name that is not (or more
realistically, "no longer") unique, we gave a fatal error
"ambiguous argument".  This error is now accompanied by hints that
lists the objects that begins with the given prefix.  During the
course of development of this new feature, numerous minor bugs were
uncovered and corrected, the most notable one of which is that we
gave "short SHA1 xxxx is ambiguous." twice without good reason.

* jk/ambiguous-short-object-names:
  get_short_sha1: make default disambiguation configurable
  get_short_sha1: list ambiguous objects on error
  for_each_abbrev: drop duplicate objects
  sha1_array: let callbacks interrupt iteration
  get_short_sha1: mark ambiguity error for translation
  get_short_sha1: NUL-terminate hex prefix
  get_short_sha1: refactor init of disambiguation code
  get_short_sha1: parse tags when looking for treeish
  get_sha1: propagate flags to child functions
  get_sha1: avoid repeating ourselves via ONLY_TO_DIE
  get_sha1: detect buggy calls with multiple disambiguators

7 years agogit-gui: avoid persisting modified author identity
Pat Thoyts [Thu, 6 Oct 2016 13:04:42 +0000 (14:04 +0100)] 
git-gui: avoid persisting modified author identity

Commit 7e71adc77f fixes a problem with git-gui failing to pick up the
original author identity during a commit --amend operation. However, the
new author details then become persistent for the remainder of the session.
This commit fixes this by ensuring the environment variables are reset
and the author information reset once the commit is completed.
The relevant changes were reworked to reduce global variables.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui: handle the encoding of Git's output correctly
Karsten Blees [Thu, 26 Feb 2015 09:19:45 +0000 (17:19 +0800)] 
git-gui: handle the encoding of Git's output correctly

If we use 'eval exec $opt $cmdp $args' to execute git command,
tcl engine will convert the output of the git comand with the rule
system default code page to unicode.

But cp936 -> unicode conversion implicitly done by exec is not reversible.
So we have to use git_read instead.

Bug report and an original reproducer by Cloud Chou:
https://github.com/msysgit/git/issues/302

Cloud Chou find the reason of the bug.

Thanks-to: Johannes Schindelin <johannes.schindelin@gmx.de>
Thanks-to: Pat Thoyts <patthoyts@users.sourceforge.net>
Reported-by: Cloud Chou <515312382@qq.com>
Original-test-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui: unicode file name support on windows
Karsten Blees [Sat, 4 Feb 2012 20:54:36 +0000 (21:54 +0100)] 
git-gui: unicode file name support on windows

Assumes file names in git tree objects are UTF-8 encoded.

On most unix systems, the system encoding (and thus the TCL system
encoding) will be UTF-8, so file names will be displayed correctly.

On Windows, it is impossible to set the system encoding to UTF-8. Changing
the TCL system encoding (via 'encoding system ...', e.g. in the startup
code) is explicitly discouraged by the TCL docs.

Change git-gui functions dealing with file names to always convert
from and to UTF-8.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoclone: detect errors in normalize_path_copy
Jeff King [Wed, 5 Oct 2016 14:29:29 +0000 (10:29 -0400)] 
clone: detect errors in normalize_path_copy

When we are copying the alternates from the source
repository, if we find a relative path that is too deep for
the source (e.g., "../../../objects" from "/repo.git/objects"),
then normalize_path_copy will report an error and leave
trash in the buffer, which we will add to our new alternates
file. Instead, let's detect the error, print a warning, and
skip copying that alternate.

There's no need to die. The relative path is probably just
broken cruft in the source repo. If it turns out to have
been important for accessing some objects, we rely on other
parts of the clone to detect that, just as they would with a
missing object in the source repo itself (though note that
clones with "-s" are inherently local, which may do fewer
object-quality checks in the first place).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agogit-commit.txt: clarify --patch mode with pathspec
Duy Nguyen [Wed, 5 Oct 2016 10:26:33 +0000 (17:26 +0700)] 
git-commit.txt: clarify --patch mode with pathspec

How pathspec is used, with and without --interactive/--patch, is
different. But this is not clear from the document. These changes hint
the user to keep reading (to option #5) instead of stopping at #2 and
assuming --patch/--interactive behaves the same way.

And since all the options listed here always mention how the index is
involved (or not) in the final commit, add that bit for #5 as well. This
"on top of the index" is implied when you head over git-add(1), but if
you just go straight to the "Interactive mode" and not read what git-add
is for, you may miss it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'dr/ru' into pu
Pat Thoyts [Tue, 4 Oct 2016 22:29:40 +0000 (23:29 +0100)] 
Merge branch 'dr/ru' into pu

7 years agogit-gui: Update Russian translation
Dimitriy Ryazantcev [Tue, 4 Oct 2016 15:15:16 +0000 (18:15 +0300)] 
git-gui: Update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui: maintain backwards compatibility for merge syntax
Pat Thoyts [Tue, 4 Oct 2016 11:49:05 +0000 (12:49 +0100)] 
git-gui: maintain backwards compatibility for merge syntax

Commit b5f325c updated to use the newer merge syntax but continue to
support older versions of git.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agohttp: http.emptyauth should allow empty (not just NULL) usernames
David Turner [Tue, 4 Oct 2016 14:53:52 +0000 (10:53 -0400)] 
http: http.emptyauth should allow empty (not just NULL) usernames

When using Kerberos authentication with newer versions of libcurl,
CURLOPT_USERPWD must be set to a value, even if it is an empty value.
The value is never sent to the server.  Previous versions of libcurl
did not require this variable to be set.  One way that some users
express the empty username/password is http://:@gitserver.example.com,
which http.emptyauth was designed to support.  Another, equivalent,
URL is http://@gitserver.example.com.  The latter leads to a username
of zero-length, rather than a NULL username, but CURLOPT_USERPWD still
needs to be set (if http.emptyauth is set).  Do so.

Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'va/i18n_2' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:40:50 +0000 (23:40 +0100)] 
Merge branch 'va/i18n_2' into pu

7 years agogit-gui i18n: mark string in lib/error.tcl for translation
Vasco Almeida [Sun, 8 May 2016 10:52:58 +0000 (10:52 +0000)] 
git-gui i18n: mark string in lib/error.tcl for translation

Mark string "$hook hook failed:" in lib/error.tcl for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui: fix incorrect use of Tcl append command
Vasco Almeida [Sun, 8 May 2016 10:52:57 +0000 (10:52 +0000)] 
git-gui: fix incorrect use of Tcl append command

Fix wrong use of append command in strings marked for translation.
According to Tcl/Tk Documentation [1],
append varName ?value value value ...?
appends all value arguments to the current value of variable varName.
This means that
append "[appname] ([reponame]): " [mc "File Viewer"]
is setting a variable named "[appname] ([reponame]): " to the output of
[mc "File Viewer"], rather than returning the concatenation of both
expressions as one might expect.

The format for some strings enables, for instance, a French translator
to translate like "%s (%s) : Create Branch" (space before colon).
Conversely, strings already translated will be marked as fuzzy and the
translator must update them herself.

For some cases, use alternative way for concatenation instead of using
strcat procedure defined in git-gui.sh.

Reference: 31bb1d1 ("git-gui: Paper bag fix missing translated strings",
2007-09-14) fixes the same issue slightly differently.

[1] http://www.tcl.tk/man/tcl/TclCmd/append.htm

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui i18n: mark "usage:" strings for translation
Vasco Almeida [Sun, 8 May 2016 10:52:56 +0000 (10:52 +0000)] 
git-gui i18n: mark "usage:" strings for translation

Mark command-line "usage:" string for translation in git-gui.sh.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui i18n: internationalize use of colon punctuation
Vasco Almeida [Sun, 8 May 2016 10:52:55 +0000 (10:52 +0000)] 
git-gui i18n: internationalize use of colon punctuation

Internationalize use of colon punctuation ':' in options window, windows
titles, database statistics window. Some languages might use a different
style, for instance French uses "User Name :" (space before colon).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'pt/non-mouse-usage' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:30:44 +0000 (23:30 +0100)] 
Merge branch 'pt/non-mouse-usage' into pu

7 years agoMerge branch 'pt/git4win-mods' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:30:32 +0000 (23:30 +0100)] 
Merge branch 'pt/git4win-mods' into pu