]> Kevux Git Server - rit/log
rit
10 years agoMerge branch 'jk/grep-binary-workaround-in-test' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:45 +0000 (11:13 -0800)]
Merge branch 'jk/grep-binary-workaround-in-test' into maint

Recent versions of GNU grep are pickier when their input contains
arbitrary binary data, which some of our tests uses.  Rewrite the
tests to sidestep the problem.

* jk/grep-binary-workaround-in-test:
  t9200: avoid grep on non-ASCII data
  t8005: avoid grep on non-ASCII data

10 years agoMerge branch 'mm/push-simple-doc' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:44 +0000 (11:13 -0800)]
Merge branch 'mm/push-simple-doc' into maint

The documentation did not clearly state that the 'simple' mode is
now the default for "git push" when push.default configuration is
not set.

* mm/push-simple-doc:
  Documentation/git-push: document that 'simple' is the default

10 years agoMerge branch 'jk/tighten-alloc' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:43 +0000 (11:13 -0800)]
Merge branch 'jk/tighten-alloc' into maint

* jk/tighten-alloc: (23 commits)
  compat/mingw: brown paper bag fix for 50a6c8e
  ewah: convert to REALLOC_ARRAY, etc
  convert ewah/bitmap code to use xmalloc
  diff_populate_gitlink: use a strbuf
  transport_anonymize_url: use xstrfmt
  git-compat-util: drop mempcpy compat code
  sequencer: simplify memory allocation of get_message
  test-path-utils: fix normalize_path_copy output buffer size
  fetch-pack: simplify add_sought_entry
  fast-import: simplify allocation in start_packfile
  write_untracked_extension: use FLEX_ALLOC helper
  prepare_{git,shell}_cmd: use argv_array
  use st_add and st_mult for allocation size computation
  convert trivial cases to FLEX_ARRAY macros
  use xmallocz to avoid size arithmetic
  convert trivial cases to ALLOC_ARRAY
  convert manual allocations to argv_array
  argv-array: add detach function
  add helpers for allocating flex-array structs
  harden REALLOC_ARRAY and xcalloc against size_t overflow
  ...

10 years agoMerge branch 'jk/more-comments-on-textconv' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:42 +0000 (11:13 -0800)]
Merge branch 'jk/more-comments-on-textconv' into maint

The memory ownership rule of fill_textconv() API, which was a bit
tricky, has been documented a bit better.

* jk/more-comments-on-textconv:
  diff: clarify textconv interface

10 years agoMerge branch 'jk/no-diff-emit-common' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:41 +0000 (11:13 -0800)]
Merge branch 'jk/no-diff-emit-common' into maint

"git merge-tree" used to mishandle "both sides added" conflict with
its own "create a fake ancestor file that has the common parts of
what both sides have added and do a 3-way merge" logic; this has
been updated to use the usual "3-way merge with an empty blob as
the fake common ancestor file" approach used in the rest of the
system.

* jk/no-diff-emit-common:
  xdiff: drop XDL_EMIT_COMMON
  merge-tree: drop generate_common strategy
  merge-one-file: use empty blob for add/add base

10 years agoMerge branch 'jc/am-i-v-fix' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:40 +0000 (11:13 -0800)]
Merge branch 'jc/am-i-v-fix' into maint

The "v(iew)" subcommand of the interactive "git am -i" command was
broken in 2.6.0 timeframe when the command was rewritten in C.

* jc/am-i-v-fix:
  am -i: fix "v"iew
  pager: factor out a helper to prepare a child process to run the pager
  pager: lose a separate argv[]

10 years agoMerge branch 'nd/git-common-dir-fix' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:39 +0000 (11:13 -0800)]
Merge branch 'nd/git-common-dir-fix' into maint

"git rev-parse --git-common-dir" used in the worktree feature
misbehaved when run from a subdirectory.

* nd/git-common-dir-fix:
  rev-parse: take prefix into account in --git-common-dir

10 years agoMerge branch 'nd/dwim-wildcards-as-pathspecs' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:39 +0000 (11:13 -0800)]
Merge branch 'nd/dwim-wildcards-as-pathspecs' into maint

"git show 'HEAD:Foo[BAR]Baz'" did not interpret the argument as a
rev, i.e. the object named by the the pathname with wildcard
characters in a tree object.

* nd/dwim-wildcards-as-pathspecs:
  get_sha1: don't die() on bogus search strings
  check_filename: tighten dwim-wildcard ambiguity
  checkout: reorder check_filename conditional

10 years agoMerge branch 'jk/epipe-in-async' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:38 +0000 (11:13 -0800)]
Merge branch 'jk/epipe-in-async' into maint

Handling of errors while writing into our internal asynchronous
process has been made more robust, which reduces flakiness in our
tests.

* jk/epipe-in-async:
  t5504: handle expected output from SIGPIPE death
  test_must_fail: report number of unexpected signal
  fetch-pack: ignore SIGPIPE in sideband demuxer
  write_or_die: handle EPIPE in async threads

10 years agoMerge branch 'ps/config-error' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:38 +0000 (11:13 -0800)]
Merge branch 'ps/config-error' into maint

Many codepaths forget to check return value from git_config_set();
the function is made to die() to make sure we do not proceed when
setting a configuration variable failed.

* ps/config-error:
  config: rename git_config_set_or_die to git_config_set
  config: rename git_config_set to git_config_set_gently
  compat: die when unable to set core.precomposeunicode
  sequencer: die on config error when saving replay opts
  init-db: die on config errors when initializing empty repo
  clone: die on config error in cmd_clone
  remote: die on config error when manipulating remotes
  remote: die on config error when setting/adding branches
  remote: die on config error when setting URL
  submodule--helper: die on config error when cloning module
  submodule: die on config error when linking modules
  branch: die on config error when editing branch description
  branch: die on config error when unsetting upstream
  branch: report errors in tracking branch setup
  config: introduce set_or_die wrappers

10 years agoMerge branch 'mg/work-tree-tests' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:38 +0000 (11:13 -0800)]
Merge branch 'mg/work-tree-tests' into maint

Traditionally, the tests that try commands that work on the
contents in the working tree were named with "worktree" in their
filenames, but with the recent addition of "git worktree"
subcommand, whose tests are also named similarly, it has become
harder to tell them apart.  The traditional tests have been renamed
to use "work-tree" instead in an attempt to differentiate them.

* mg/work-tree-tests:
  tests: rename work-tree tests to *work-tree*

10 years agoMerge branch 'sp/remote-curl-ssl-strerror' into maint
Junio C Hamano [Thu, 10 Mar 2016 19:13:37 +0000 (11:13 -0800)]
Merge branch 'sp/remote-curl-ssl-strerror' into maint

Help those who debug http(s) part of the system.

* sp/remote-curl-ssl-strerror:
  remote-curl: include curl_errorstr on SSL setup failures

10 years agoMerge branch 'jx/http-no-proxy'
Junio C Hamano [Thu, 10 Mar 2016 18:56:43 +0000 (10:56 -0800)]
Merge branch 'jx/http-no-proxy'

* jx/http-no-proxy:
  http: honor no_http env variable to bypass proxy

10 years agoMerge branch 'jc/exclusion-doc'
Junio C Hamano [Thu, 10 Mar 2016 18:56:43 +0000 (10:56 -0800)]
Merge branch 'jc/exclusion-doc'

* jc/exclusion-doc:
  gitignore: document that unignoring a directory unignores everything in it

10 years agoMerge branch 'js/close-packs-before-gc'
Junio C Hamano [Thu, 10 Mar 2016 18:56:42 +0000 (10:56 -0800)]
Merge branch 'js/close-packs-before-gc'

A small future-proofing of a test added recently.

* js/close-packs-before-gc:
  t5510: do not leave changed cwd

10 years agoMerge branch 'sb/rebase-summary'
Junio C Hamano [Thu, 10 Mar 2016 18:56:41 +0000 (10:56 -0800)]
Merge branch 'sb/rebase-summary'

* sb/rebase-summary:
  Documentation: reword rebase summary

10 years agoDisown ssh+git and git+ssh
Carlos Martín Nieto [Mon, 15 Feb 2016 14:29:06 +0000 (15:29 +0100)]
Disown ssh+git and git+ssh

Some people argue that these were silly from the beginning (see
http://thread.gmane.org/gmane.comp.version-control.git/285590/focus=285601
for example), but we have to support them for compatibility.

That doesn't mean we have to show them in the documentation.  These
were already left out of the main list, but a reference in the main
manpage was left, so remove that.

Also add a note to discourage their use if anybody goes looking for them
in the source code.

Signed-off-by: Carlos Martín Nieto <cmn@dwim.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogitignore: document that unignoring a directory unignores everything in it
Junio C Hamano [Mon, 7 Mar 2016 23:27:27 +0000 (15:27 -0800)]
gitignore: document that unignoring a directory unignores everything in it

Also document another limitation coming from a bug in handling the
basename match with a directory for 're-inclusion'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agouse setup_git_directory() in test-* programs
Jeff King [Sat, 5 Mar 2016 22:16:50 +0000 (17:16 -0500)]
use setup_git_directory() in test-* programs

Some of the test-* programs rely on examining refs, but did
not bother to make sure we are actually in a git repository.
Let's have them call setup_git_directory() to do so.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogrep: turn off gitlink detection for --no-index
Jeff King [Mon, 7 Mar 2016 15:51:21 +0000 (10:51 -0500)]
grep: turn off gitlink detection for --no-index

If we are running "git grep --no-index" outside of a git
repository, we behave roughly like "grep -r", examining all
files in the current directory and its subdirectories.
However, because we use fill_directory() to do the
recursion, it will skip over any directories which look like
sub-repositories.

For a normal git operation (like "git grep" in a repository)
this makes sense; we do not want to cross the boundary out
of our current repository into a submodule. But for
"--no-index" without a repository, we should look at all
files, including embedded repositories.

There is one exception, though: we probably should _not_
descend into ".git" directories. Doing so is inefficient and
unlikely to turn up useful hits.

This patch drops our use of dir.c's gitlink-detection, but
we do still avoid ".git". That makes us more like tools such
as "ack" or "ag", which also know to avoid cruft in .git.

As a bonus, this also drops our usage of the ref code
when we are outside of a repository, making the transition
to pluggable ref backends cleaner.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoDocumentation: talk about pager in api-trace.txt
Christian Couder [Mon, 7 Mar 2016 10:38:53 +0000 (11:38 +0100)]
Documentation: talk about pager in api-trace.txt

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot6302: skip only signed tags rather than all tests when GPG is missing
Eric Sunshine [Mon, 7 Mar 2016 00:10:27 +0000 (19:10 -0500)]
t6302: skip only signed tags rather than all tests when GPG is missing

The primary purpose of these tests is to check filtering, sorting, and
formatting behavior of git-for-each-ref, so it is unfortunate that the
entire test script is skipped when GPG is not present. Rather than
skipping all tests, let's instead just skip testing against signed tags
when GPG is missing.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot6302: also test annotated in addition to signed tags
Eric Sunshine [Mon, 7 Mar 2016 00:10:26 +0000 (19:10 -0500)]
t6302: also test annotated in addition to signed tags

It is conceivable, if not highly plausible, that a change to the
git-for-each-ref code that does the filtering and formatting can become
buggy because a payload with GPG signature looks somewhat different from
what is in an annotated but not signed tag. Thus, let's test unsigned
tags, as well.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot6302: normalize names and descriptions of signed tags
Eric Sunshine [Mon, 7 Mar 2016 00:10:25 +0000 (19:10 -0500)]
t6302: normalize names and descriptions of signed tags

An upcoming patch will increase test coverage by testing annotated but
not signed tags, as well, so normalize names and descriptions of signed
tags to make it easy to give the upcoming unsigned tags similarly
patterned names and descriptions.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agolib-gpg: drop unnecessary "missing GPG" warning
Eric Sunshine [Mon, 7 Mar 2016 00:10:24 +0000 (19:10 -0500)]
lib-gpg: drop unnecessary "missing GPG" warning

When 37d3e85 (t7004: factor out gpg setup, 2011-09-07) pulled gpg
detection code out of t7004-tag.sh and turned it into a standard test
prerequisite, it added an unconditional "missing GPG" warning when gpg
is not detected.

However, this is redundant since all tests which require GPG already
warn via either 'test_expect_success GPG' ("skipping: missing GPG") on a
test-by-test basis, or when skipping all tests in a script ("skipping
all foobar tests; missing GPG").  Consequently, the extra warning from
lib-gpg.sh is unnecessary, so retire it.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agomailmap: do not resolve blobs in a non-repository
Jeff King [Sat, 5 Mar 2016 22:13:29 +0000 (17:13 -0500)]
mailmap: do not resolve blobs in a non-repository

The mailmap code may be triggered outside of a repository by
git-shortlog. There is no point in looking up a name like
"HEAD:.mailmap" there; without a repository, we have no
refs.

This is unlikely to matter much in practice for the current
code, as we would simply fail to find the ref. But as the
refs code learns about new backends, this is more important;
without a repository, we do not even know which backend to
look at.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoremote: don't resolve HEAD in non-repository
Jeff King [Sat, 5 Mar 2016 22:11:57 +0000 (17:11 -0500)]
remote: don't resolve HEAD in non-repository

The remote-config code wants to look at HEAD to mark the
current branch specially. But if we are not in a repository
(e.g., running "git archive --remote"), this makes no sense;
there is no HEAD to look at, and we have no current branch.

This doesn't really cause any bugs in practice (if you are
not in a repo, you probably don't have a .git/HEAD file),
but we should be more careful about triggering the refs code
at all in a non-repo. As we grow new ref backends, we would
not even know which backend to use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosetup: set startup_info->have_repository more reliably
Jeff King [Sat, 5 Mar 2016 22:11:34 +0000 (17:11 -0500)]
setup: set startup_info->have_repository more reliably

When setup_git_directory() is called, we set a flag in
startup_info to indicate we have a repository. But there are
a few other mechanisms by which we might set up a repo:

  1. When creating a new repository via init_db(), we
     transition from no-repo to being in a repo. We should
     tweak this flag at that moment.

  2. In enter_repo(), a stricter form of
     setup_git_directory() used by server-side programs, we
     check the repository format config. After doing so, we
     know we're in a repository, and can set the flag.

With these changes, library code can now reliably tell
whether we are in a repository and act accordingly. We'll
leave the "prefix" field as NULL, which is what happens when
setup_git_directory() finds there is no prefix.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosetup: make startup_info available everywhere
Jeff King [Sat, 5 Mar 2016 22:10:27 +0000 (17:10 -0500)]
setup: make startup_info available everywhere

Commit a60645f (setup: remember whether repository was
found, 2010-08-05) introduced the startup_info structure,
which records some parts of the setup_git_directory()
process (notably, whether we actually found a repository or
not).

One of the uses of this data is for functions to behave
appropriately based on whether we are in a repo. But the
startup_info struct is just a pointer to storage provided by
the main program, and the only program that sets it up is
the git.c wrapper. Thus builtins have access to
startup_info, but externally linked programs do not.

Worse, library code which is accessible from both has to be
careful about accessing startup_info. This can be used to
trigger a die("BUG") via get_sha1():

$ git fast-import <<-\EOF
tag foo
from HEAD:./whatever
EOF

fatal: BUG: startup_info struct is not initialized.

Obviously that's fairly nonsensical input to feed to
fast-import, but we should never hit a die("BUG"). And there
may be other ways to trigger it if other non-builtins
resolve sha1s.

So let's point the storage for startup_info to a static
variable in setup.c, making it available to all users of the
library code. We _could_ turn startup_info into a regular
extern struct, but doing so would mean tweaking all of the
existing use sites. So let's leave the pointer indirection
in place.  We can, however, drop any checks for NULL, as
they will always be false (and likewise, we can drop the
test covering this case, which was a rather artificial
situation using one of the test-* programs).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agostrbuf_getwholeline: NUL-terminate getdelim buffer on error
Jeff King [Sat, 5 Mar 2016 18:43:30 +0000 (13:43 -0500)]
strbuf_getwholeline: NUL-terminate getdelim buffer on error

Commit 0cc30e0 (strbuf_getwholeline: use getdelim if it is
available, 2015-04-16) tries to clean up after getdelim()
returns EOF, but gets one case wrong, which can lead in some
obscure cases to us reading uninitialized memory.

After getdelim() returns -1, we re-initialize the strbuf
only if sb->buf is NULL. The thinking was that either:

  1. We fed an existing allocated buffer to getdelim(), and
     at most it would have realloc'd, leaving our NUL in
     place.

  2. We didn't have a buffer to feed, so we gave getdelim()
     NULL; sb->buf will remain NULL, and we just want to
     restore the empty slopbuf.

But that second case isn't quite right. getdelim() may
allocate a buffer, write nothing into it, and then return
EOF. The resulting strbuf rightfully has sb->len set to "0",
but is missing the NUL terminator in the first byte.

Most call-sites are fine with this. They see the EOF and
don't bother looking at the strbuf. Or they notice that
sb->len is empty, and don't look at the contents. But
there's at least one case that does neither, and relies on
parsing the resulting (possibly zero-length) string:
fast-import. You can see this in action with the new test
(though we probably only notice failure there when run with
--valgrind or ASAN).

We can fix this by unconditionally resetting the strbuf when
we have a buffer after getdelim(). That fixes case 2 above.
Case 1 is probably already fine in practice, but it does not
hurt for us to re-assert our invariants (especially because
we are relying on whatever getdelim() happens to do, which
may vary from platform to platform). Our fix covers that
case, too.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agofetch-pack: update the documentation for "<refs>..." arguments
Gabriel Souza Franco [Sat, 5 Mar 2016 01:11:38 +0000 (22:11 -0300)]
fetch-pack: update the documentation for "<refs>..." arguments

When we started allowing an exact object name to be fetched from the
command line, we forgot to update the documentation.

Signed-off-by: Gabriel Souza Franco <gabrielfrancosouza@gmail.com>
--
 Documentation/git-fetch-pack.txt | 4 ++++
 1 file changed, 4 insertions(+)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: de.po: translate 48 new messages
Ralf Thielow [Wed, 2 Mar 2016 17:13:32 +0000 (18:13 +0100)]
l10n: de.po: translate 48 new messages

Translate 48 new messages came from git.pot update in
9eb3984 (l10n: git.pot: v2.8.0 round 1 (48 new, 16 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
10 years agol10n: de.po: translate "command" as "Befehl"
Ralf Thielow [Thu, 3 Mar 2016 18:00:35 +0000 (19:00 +0100)]
l10n: de.po: translate "command" as "Befehl"

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Phillip Sz <phillip.szelat@gmail.com>
10 years agol10n: de.po: fix interactive rebase message
Ralf Thielow [Wed, 2 Mar 2016 17:34:19 +0000 (18:34 +0100)]
l10n: de.po: fix interactive rebase message

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
10 years agol10n: de.po: add space to abbreviation "z. B."
Ralf Thielow [Wed, 2 Mar 2016 17:27:42 +0000 (18:27 +0100)]
l10n: de.po: add space to abbreviation "z. B."

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Phillip Sz <phillip.szelat@gmail.com>
10 years agol10n: de.po: fix typo
Christoph Hoopmann [Wed, 2 Mar 2016 11:46:26 +0000 (12:46 +0100)]
l10n: de.po: fix typo

Signed-off-by: Christoph Hoopmann <christophhoopmann@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
10 years agol10n: TEAMS: update Ralf Thielow's email address
Ralf Thielow [Thu, 3 Mar 2016 20:48:25 +0000 (21:48 +0100)]
l10n: TEAMS: update Ralf Thielow's email address

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
10 years agoMerge branch 'master' of git://github.com/nafmo/git-l10n-sv
Jiang Xin [Sat, 5 Mar 2016 02:06:20 +0000 (10:06 +0800)]
Merge branch 'master' of git://github.com/nafmo/git-l10n-sv

* 'master' of git://github.com/nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (2509t0f0u)
  l10n: sv.po: Fix inconsistent translation of "progress meter"

10 years agoMerge branch 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-ko
Jiang Xin [Sat, 5 Mar 2016 02:05:32 +0000 (10:05 +0800)]
Merge branch 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-ko

* 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-ko:
  l10n: ko.po: Update Korean translation

10 years agoxdiff/xprepare: fix a memory leak
Ramsay Jones [Fri, 4 Mar 2016 23:10:50 +0000 (23:10 +0000)]
xdiff/xprepare: fix a memory leak

The xdl_prepare_env() function may initialise an xdlclassifier_t
data structure via xdl_init_classifier(), which allocates memory
to several fields, for example 'rchash', 'rcrecs' and 'ncha'.
If this function later exits due to the failure of xdl_optimize_ctxs(),
then this xdlclassifier_t structure, and the memory allocated to it,
is not cleaned up.

In order to fix the memory leak, insert a call to xdl_free_classifier()
before returning.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoxdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
Ramsay Jones [Fri, 4 Mar 2016 23:09:36 +0000 (23:09 +0000)]
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits

Commit 307ab20b3 ("xdiff: PATIENCE/HISTOGRAM are not independent option
bits", 19-02-2012) introduced the XDF_DIFF_ALG() macro to access the
flag bits used to represent the diff algorithm requested. In addition,
code which had used explicit manipulation of the flag bits was changed
to use the macros.

However, one example of direct manipulation remains. Update this code to
use the XDF_DIFF_ALG() macro.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoGit 2.8-rc1
Junio C Hamano [Fri, 4 Mar 2016 21:48:55 +0000 (13:48 -0800)]
Git 2.8-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'nd/clear-gitenv-upon-use-of-alias'
Junio C Hamano [Fri, 4 Mar 2016 21:46:44 +0000 (13:46 -0800)]
Merge branch 'nd/clear-gitenv-upon-use-of-alias'

Hotfix for a test breakage made between 2.7 and 'master'.

* nd/clear-gitenv-upon-use-of-alias:
  t0001: fix GIT_* environment variable check under --valgrind

10 years agoMerge branch 'js/pthread-exit-emu-windows'
Junio C Hamano [Fri, 4 Mar 2016 21:46:39 +0000 (13:46 -0800)]
Merge branch 'js/pthread-exit-emu-windows'

* js/pthread-exit-emu-windows:
  Mark win32's pthread_exit() as NORETURN

10 years agoMerge branch 'sb/submodule-parallel-fetch'
Junio C Hamano [Fri, 4 Mar 2016 21:46:30 +0000 (13:46 -0800)]
Merge branch 'sb/submodule-parallel-fetch'

Simplify the two callback functions that are triggered when the
child process terminates to avoid misuse of the child-process
structure that has already been cleaned up.

* sb/submodule-parallel-fetch:
  run-command: do not pass child process data into callbacks

10 years agoMerge branch 'jk/tighten-alloc'
Junio C Hamano [Fri, 4 Mar 2016 21:46:25 +0000 (13:46 -0800)]
Merge branch 'jk/tighten-alloc'

* jk/tighten-alloc:
  compat/mingw: brown paper bag fix for 50a6c8e

10 years agoMerge branch 'nd/i18n-2.8.0'
Junio C Hamano [Fri, 4 Mar 2016 21:46:20 +0000 (13:46 -0800)]
Merge branch 'nd/i18n-2.8.0'

* nd/i18n-2.8.0:
  trailer.c: mark strings for translation
  ref-filter.c: mark strings for translation
  builtin/clone.c: mark strings for translation
  builtin/checkout.c: mark strings for translation

10 years agoMerge branch 'tb/avoid-gcc-on-darwin-10-6'
Junio C Hamano [Fri, 4 Mar 2016 21:46:08 +0000 (13:46 -0800)]
Merge branch 'tb/avoid-gcc-on-darwin-10-6'

Out-of-maintenance gcc on OSX 10.6 fails to compile the code in
'master'; work it around by using clang by default on the platform.

* tb/avoid-gcc-on-darwin-10-6:
  config.mak.uname: use clang for Mac OS X 10.6

10 years agoMerge branch 'jk/pack-idx-corruption-safety'
Junio C Hamano [Fri, 4 Mar 2016 21:45:46 +0000 (13:45 -0800)]
Merge branch 'jk/pack-idx-corruption-safety'

The code to read the pack data using the offsets stored in the pack
idx file has been made more carefully check the validity of the
data in the idx.

* jk/pack-idx-corruption-safety:
  sha1_file.c: mark strings for translation
  use_pack: handle signed off_t overflow
  nth_packed_object_offset: bounds-check extended offset
  t5313: test bounds-checks of corrupted/malicious pack/idx files

10 years agoMerge branch 'mg/httpd-tests-update-for-apache-2.4'
Junio C Hamano [Fri, 4 Mar 2016 21:45:42 +0000 (13:45 -0800)]
Merge branch 'mg/httpd-tests-update-for-apache-2.4'

The way the test scripts configure the Apache web server has been
updated to work also for Apache 2.4 running on RedHat derived
distros.

* mg/httpd-tests-update-for-apache-2.4:
  t/lib-httpd: load mod_unixd

10 years agot5510: do not leave changed cwd
Michael J Gruber [Fri, 4 Mar 2016 10:53:50 +0000 (11:53 +0100)]
t5510: do not leave changed cwd

t5510 carefully keeps the cwd at the test root by using either subshells
or explicit cd'ing back to the root. Use a subshell for the last
subtest, too.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'js/mingw-tests'
Junio C Hamano [Fri, 4 Mar 2016 18:14:39 +0000 (10:14 -0800)]
Merge branch 'js/mingw-tests'

* js/mingw-tests:
  t9700: fix test for perl older than 5.14

10 years agot9700: fix test for perl older than 5.14
Jeff King [Fri, 4 Mar 2016 11:43:21 +0000 (06:43 -0500)]
t9700: fix test for perl older than 5.14

Commit d53c2c6 (mingw: fix t9700's assumption about
directory separators, 2016-01-27) uses perl's "/r" regex
modifier to do a non-destructive replacement on a string,
leaving the original unmodified and returning the result.

This feature was introduced in perl 5.14, but systems with
older perl are still common (e.g., CentOS 6.5 still has perl
5.10). Let's work around it by providing a helper function
that does the same thing using older syntax.

While we're at it, let's switch to using an alternate regex
separator, which is slightly more readable.

Reported-by: Christian Couder <christian.couder@gmail.com>
Helped-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: sv.po: Update Swedish translation (2509t0f0u)
Peter Krefting [Fri, 4 Mar 2016 14:22:46 +0000 (15:22 +0100)]
l10n: sv.po: Update Swedish translation (2509t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
10 years agol10n: sv.po: Fix inconsistent translation of "progress meter"
Peter Krefting [Wed, 3 Feb 2016 19:27:59 +0000 (20:27 +0100)]
l10n: sv.po: Fix inconsistent translation of "progress meter"

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
10 years agodocumentation: fix some typos
Thomas Ackermann [Thu, 3 Mar 2016 18:43:51 +0000 (19:43 +0100)]
documentation: fix some typos

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoindex-pack: add a helper function to derive .idx/.keep filename
Junio C Hamano [Thu, 3 Mar 2016 19:29:09 +0000 (11:29 -0800)]
index-pack: add a helper function to derive .idx/.keep filename

These are automatically named by replacing .pack suffix in the
name of the packfile.  Add a small helper to do so, as I'll be
adding another one soonish.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jc/maint-index-pack-keep' into jc/index-pack
Junio C Hamano [Thu, 3 Mar 2016 21:16:45 +0000 (13:16 -0800)]
Merge branch 'jc/maint-index-pack-keep' into jc/index-pack

* jc/maint-index-pack-keep:
  index-pack: correct --keep[=<msg>]

10 years agoindex-pack: correct --keep[=<msg>]
Junio C Hamano [Thu, 3 Mar 2016 18:52:53 +0000 (10:52 -0800)]
index-pack: correct --keep[=<msg>]

When 592ce208 (index-pack: use strip_suffix to avoid magic numbers,
2014-06-30) refactored the code to derive names of .idx and .keep
files from the name of .pack file, a copy-and-paste typo crept in,
mistakingly attempting to create and store the keep message file in
the .idx file we just created, instead of .keep file.

As we create the .keep file with O_CREAT|O_EXCL, and we do so after
we write the .idx file, we luckily do not clobber the .idx file, but
because we deliberately ignored EEXIST when creating .keep file
(which is justifiable because only the existence of .keep file
matters), nobody noticed this mistake so far.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot0001: fix GIT_* environment variable check under --valgrind
Johannes Sixt [Thu, 3 Mar 2016 06:55:17 +0000 (07:55 +0100)]
t0001: fix GIT_* environment variable check under --valgrind

When a test case is run without --valgrind, the wrap-for-bin.sh
helper script inserts the environment variable GIT_TEXTDOMAINDIR, but
when run with --valgrind, the variable is missing. A recently
introduced test case expects the presence of the variable, though, and
fails under --valgrind.

Rewrite the test case to strip conditially defined environment variables
from both expected and actual output.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: ko.po: Update Korean translation
Changwoo Ryu [Thu, 3 Mar 2016 04:14:28 +0000 (13:14 +0900)]
l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>
10 years agoDocumentation: reword rebase summary
Stefan Beller [Tue, 1 Mar 2016 22:49:58 +0000 (14:49 -0800)]
Documentation: reword rebase summary

The wording is introduced in c3f0baaca (Documentation: sync git.txt
command list and manual page title, 2007-01-18), but rebase has evolved
since then, capture the modern usage by being more generic about the
rebase command in the summary.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMark win32's pthread_exit() as NORETURN
Johannes Schindelin [Wed, 2 Mar 2016 19:11:13 +0000 (20:11 +0100)]
Mark win32's pthread_exit() as NORETURN

The pthread_exit() function is not expected to return. Ever. On Windows,
we call ExitThread() whose documentation claims: "Ends the calling
thread", i.e. there is no condition in which this function simply
returns: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659

While at it, fix the return type to be void, as per
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html

Pointed out by Jeff King, helped by Stefan Naewe, Junio Hamano &
Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: ru.po: update Russian translation
Dimitriy Ryazantcev [Wed, 2 Mar 2016 15:37:55 +0000 (17:37 +0200)]
l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
10 years agobuiltin/receive-pack.c: use parse_options API
Sidhant Sharma [:tk] [Tue, 1 Mar 2016 20:21:01 +0000 (01:51 +0530)]
builtin/receive-pack.c: use parse_options API

Make receive-pack use the parse_options API,
bringing it more in line with send-pack and push.

Helped-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Sidhant Sharma [:tk] <tigerkid001@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogit: submodule honor -c credential.* from command line
Jacob Keller [Mon, 29 Feb 2016 22:58:35 +0000 (14:58 -0800)]
git: submodule honor -c credential.* from command line

Due to the way that the git-submodule code works, it clears all local
git environment variables before entering submodules. This is normally
a good thing since we want to clear settings such as GIT_WORKTREE and
other variables which would affect the operation of submodule commands.
However, GIT_CONFIG_PARAMETERS is special, and we actually do want to
preserve these settings. However, we do not want to preserve all
configuration as many things should be left specific to the parent
project.

Add a git submodule--helper function, sanitize-config, which shall be
used to sanitize GIT_CONFIG_PARAMETERS, removing all key/value pairs
except a small subset that are known to be safe and necessary.

Replace all the calls to clear_local_git_env with a wrapped function
that filters GIT_CONFIG_PARAMETERS using the new helper and then
restores it to the filtered subset after clearing the rest of the
environment.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoquote: implement sq_quotef()
Jacob Keller [Mon, 29 Feb 2016 22:58:34 +0000 (14:58 -0800)]
quote: implement sq_quotef()

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule: fix segmentation fault in submodule--helper clone
Jacob Keller [Mon, 29 Feb 2016 22:58:33 +0000 (14:58 -0800)]
submodule: fix segmentation fault in submodule--helper clone

The git submodule--helper clone command will fail with a segmentation
fault when given a null url or null path variable. Since these are
required for proper functioning of the submodule--helper clone
subcommand, add checks to prevent running and fail gracefully when
missing.

Update the usage string to reflect the requirement that the --url and
--path "options" are required.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule: fix submodule--helper clone usage
Jacob Keller [Mon, 29 Feb 2016 22:58:32 +0000 (14:58 -0800)]
submodule: fix submodule--helper clone usage

git submodule--helper clone usage stated that paths were added after the
[--] argument. The actual implementation required use of --path argument
and only supports one path at a time. Update the usage string to match
the current implementation.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule: check argc count for git submodule--helper clone
Jacob Keller [Mon, 29 Feb 2016 22:58:31 +0000 (14:58 -0800)]
submodule: check argc count for git submodule--helper clone

Extra unused arguments to git submodule--helper clone subcommand were
being silently ignored. Add a check to the argc count after options
handling to ensure that no extra arguments were left on the argv array.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule: don't pass empty string arguments to submodule--helper clone
Jacob Keller [Mon, 29 Feb 2016 22:58:30 +0000 (14:58 -0800)]
submodule: don't pass empty string arguments to submodule--helper clone

When --reference or --depth are unused, the current git-submodule.sh
results in empty "" arguments appended to the end of the argv array
inside git submodule--helper clone. This is not caught because the argc
count is not checked today.

Fix git-submodule.sh to only pass an argument when --reference or
--depth are used, preventing the addition of two empty string arguments
on the tail of the argv array.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclone: allow an explicit argument for parallel submodule clones
Stefan Beller [Tue, 1 Mar 2016 02:07:20 +0000 (18:07 -0800)]
clone: allow an explicit argument for parallel submodule clones

Just pass it along to "git submodule update", which may pick reasonable
defaults if you don't specify an explicit number.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule update: expose parallelism to the user
Stefan Beller [Tue, 1 Mar 2016 02:07:19 +0000 (18:07 -0800)]
submodule update: expose parallelism to the user

Expose possible parallelism either via the "--jobs" CLI parameter or
the "submodule.fetchJobs" setting.

By having the variable initialized to -1, we make sure 0 can be passed
into the parallel processing machine, which will then pick as many parallel
workers as there are CPUs.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule helper: remove double 'fatal: ' prefix
Stefan Beller [Tue, 1 Mar 2016 02:07:18 +0000 (18:07 -0800)]
submodule helper: remove double 'fatal: ' prefix

The prefix is added by die(...), so we don't have to do it.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogit submodule update: have a dedicated helper for cloning
Stefan Beller [Tue, 1 Mar 2016 02:07:17 +0000 (18:07 -0800)]
git submodule update: have a dedicated helper for cloning

This introduces a new helper function in git submodule--helper
which takes care of cloning all submodules, which we want to
parallelize eventually.

Some tests (such as empty URL, update_mode=none) are required in the
helper to make the decision for cloning. These checks have been
moved into the C function as well (no need to repeat them in the
shell script).

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorun_processes_parallel: rename parameters for the callbacks
Stefan Beller [Tue, 1 Mar 2016 02:07:16 +0000 (18:07 -0800)]
run_processes_parallel: rename parameters for the callbacks

The refs code has a similar pattern of passing around 'struct strbuf *err',
which is strictly used for error reporting. This is not the case here,
as the strbuf is used to accumulate all the output (whether it is error
or not) for the user. Rename it to 'out'.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorun_processes_parallel: treat output of children as byte array
Stefan Beller [Tue, 1 Mar 2016 02:07:15 +0000 (18:07 -0800)]
run_processes_parallel: treat output of children as byte array

We do not want the output to be interrupted by a NUL byte, so we
cannot use raw fputs. Introduce strbuf_write to avoid having long
arguments in run-command.c.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule update: direct error message to stderr
Stefan Beller [Tue, 1 Mar 2016 02:07:14 +0000 (18:07 -0800)]
submodule update: direct error message to stderr

Reroute the error message for specified but initialized submodules
to stderr instead of stdout.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agofetching submodules: respect `submodule.fetchJobs` config option
Stefan Beller [Tue, 1 Mar 2016 02:07:13 +0000 (18:07 -0800)]
fetching submodules: respect `submodule.fetchJobs` config option

This allows to configure fetching and updating in parallel
without having the command line option.

This moved the responsibility to determine how many parallel processes
to start from builtin/fetch to submodule.c as we need a way to communicate
"The user did not specify the number of parallel processes in the command
line options" in the builtin fetch. The submodule code takes care of
the precedence (CLI > config > default).

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule-config: drop check against NULL
Stefan Beller [Tue, 1 Mar 2016 02:07:12 +0000 (18:07 -0800)]
submodule-config: drop check against NULL

Adhere to the common coding style of Git and not check explicitly
for NULL throughout the file. There are still other occurrences in the
code base but that is usually inside of conditions with side effects.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubmodule-config: keep update strategy around
Stefan Beller [Tue, 1 Mar 2016 02:07:11 +0000 (18:07 -0800)]
submodule-config: keep update strategy around

Currently submodule.<name>.update is only handled by git-submodule.sh.
C code will start to need to make use of that value as more of the
functionality of git-submodule.sh moves into library code in C.

Add the update field to 'struct submodule' and populate it so it can
be read as sm->update or from sm->update_command.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agofetch-pack: fix object_id of exact sha1
Gabriel Souza Franco [Tue, 1 Mar 2016 02:12:56 +0000 (23:12 -0300)]
fetch-pack: fix object_id of exact sha1

Commit 58f2ed0 (remote-curl: pass ref SHA-1 to fetch-pack as well,
2013-12-05) added support for specifying a SHA-1 as well as a ref name.
Add support for specifying just a SHA-1 and set the ref name to the same
value in this case.

Signed-off-by: Gabriel Souza Franco <gabrielfrancosouza@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agodir: store EXC_FLAG_* values in unsigned integers
Saurav Sachidanand [Tue, 1 Mar 2016 17:02:59 +0000 (22:32 +0530)]
dir: store EXC_FLAG_* values in unsigned integers

The values defined by the macro EXC_FLAG_* (1, 4, 8, 16) are stored
in fields of the structs "pattern" and "exclude", some functions
arguments and a local variable.  None of these uses its most
significant bit in any special way and there is no good reason to
use a signed integer for them.

And while we're at it, document "flags" of "exclude" to explicitly
state the values it's supposed to take on.

Signed-off-by: Saurav Sachidanand <sauravsachidanand@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agolockfile: improve error message when lockfile exists
Matthieu Moy [Tue, 1 Mar 2016 17:04:10 +0000 (18:04 +0100)]
lockfile: improve error message when lockfile exists

A common mistake leading a user to see this message is to launch "git
commit", let the editor open (and forget about it), and try again to
commit.

The previous message was going too quickly to "a git process crashed"
and to the advice "remove the file manually".

This patch modifies the message in two ways: first, it considers that
"another process is running" is the norm, not the exception, and it
explicitly hints the user to look at text editors.

The message is 2 lines longer, but this is not a problem since
experienced users do not see the message often.

Helped-by: Moritz Neeb <lists@moritzneeb.de>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agolockfile: mark strings for translation
Matthieu Moy [Tue, 1 Mar 2016 17:04:09 +0000 (18:04 +0100)]
lockfile: mark strings for translation

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorun-command: do not pass child process data into callbacks
Stefan Beller [Mon, 29 Feb 2016 21:57:06 +0000 (13:57 -0800)]
run-command: do not pass child process data into callbacks

The expected way to pass data into the callback is to pass them via
the customizable callback pointer. The error reporting in
default_{start_failure, task_finished} is not user friendly enough, that
we want to encourage using the child data for such purposes.

Furthermore the struct child data is cleaned by the run-command API,
before we access them in the callbacks, leading to use-after-free
situations.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agotrailer.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:42:10 +0000 (13:42 +0700)]
trailer.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoref-filter.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:42:04 +0000 (13:42 +0700)]
ref-filter.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobuiltin/clone.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:41:55 +0000 (13:41 +0700)]
builtin/clone.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobuiltin/checkout.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:41:54 +0000 (13:41 +0700)]
builtin/checkout.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agohttp: honor no_http env variable to bypass proxy
Jiang Xin [Mon, 29 Feb 2016 15:16:57 +0000 (23:16 +0800)]
http: honor no_http env variable to bypass proxy

Curl and its families honor several proxy related environment variables:

* http_proxy and https_proxy define proxy for http/https connections.
* no_proxy (a comma separated hosts) defines hosts bypass the proxy.

This command will bypass the bad-proxy and connect to the host directly:

    no_proxy=* https_proxy=http://bad-proxy/ \
    curl -sk https://google.com/

Before commit 372370f (http: use credential API to handle proxy auth...),
Environment variable "no_proxy" will take effect if the config variable
"http.proxy" is not set.  So the following comamnd won't fail if not
behind a firewall.

    no_proxy=* https_proxy=http://bad-proxy/ \
    git ls-remote https://github.com/git/git

But commit 372370f not only read git config variable "http.proxy", but
also read "http_proxy" and "https_proxy" environment variables, and set
the curl option using:

    curl_easy_setopt(result, CURLOPT_PROXY, proxy_auth.host);

This caused "no_proxy" environment variable not working any more.

Set extra curl option "CURLOPT_NOPROXY" will fix this issue.

Signed-off-by: Jiang Xin <xin.jiang@huawei.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocompat/mingw: brown paper bag fix for 50a6c8e
Jeff King [Mon, 29 Feb 2016 10:02:59 +0000 (05:02 -0500)]
compat/mingw: brown paper bag fix for 50a6c8e

Commit 50a6c8e (use st_add and st_mult for allocation size
computation, 2016-02-22) fixed up many xmalloc call-sites
including ones in compat/mingw.c.

But I screwed up one of them, which was half-converted to
ALLOC_ARRAY, using a very early prototype of the function.
And I never caught it because I don't build on Windows.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorev-parse: let some options run outside repository
Jeff King [Mon, 29 Feb 2016 11:01:56 +0000 (06:01 -0500)]
rev-parse: let some options run outside repository

Once upon a time, you could use "--local-env-vars" and
"--resolve-git-dir" outside of any git repository, but they
had to come first on the command line. Commit 68889b4
(rev-parse: remove restrictions on some options, 2013-07-21)
put them into the normal option-parsing loop, fixing the
latter. But it inadvertently broke the former, as we call
setup_git_directory() before starting that loop.

We can note that those options don't care even conditionally
about whether we are in a git repo. So it's fine if we
simply wait to setup the repo until we see an option that
needs it.

However, there is one special exception we should make:
historically, rev-parse will set up the repository and read
config even if there are _no_ options. Some of the
tests in t1300 rely on this to check "git -c $config"
parsing. That's not mirroring real-world use, and we could
tweak the test.  But t0002 uses a bare "git rev-parse" to
check "are we in a git repository?". It's plausible that
real-world scripts are relying on this.

So let's cover this case specially, and treat an option-less
"rev-parse" as "see if we're in a repo".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'master' of https://github.com/vnwildman/git
Jiang Xin [Mon, 29 Feb 2016 15:31:58 +0000 (23:31 +0800)]
Merge branch 'master' of https://github.com/vnwildman/git

* 'master' of https://github.com/vnwildman/git:
  l10n: vi.po (2509t): Updated Vietnamese translation

10 years agol10n: vi.po (2509t): Updated Vietnamese translation
Tran Ngoc Quan [Mon, 29 Feb 2016 00:47:45 +0000 (07:47 +0700)]
l10n: vi.po (2509t): Updated Vietnamese translation

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
10 years agoconfig.mak.uname: use clang for Mac OS X 10.6
Torsten Bögershausen [Sun, 28 Feb 2016 20:09:44 +0000 (21:09 +0100)]
config.mak.uname: use clang for Mac OS X 10.6

Gcc under Mac OX 10.6 throws an internal compiler error:

CC combine-diff.o
    combine-diff.c: In function ‘diff_tree_combined’:
    combine-diff.c:1391: internal compiler error: Segmentation fault

while attempting to build Git at 5b442c4f (tree-diff: catch integer
overflow in combine_diff_path allocation, 2016-02-19).

As clang that ships with the version does not have the same bug,
make Git compile under Mac OS X 10.6 by using clang instead of gcc
to work this around, as it is unlikely that we will see fixed GCC
on that platform.

Later versions of Mac OSX/Xcode only provide clang, and gcc is a
wrapper to it.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: fr.po v2.8.0 round 1 2509t
Jean-Noel Avila [Sun, 28 Feb 2016 21:44:35 +0000 (22:44 +0100)]
l10n: fr.po v2.8.0 round 1 2509t

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
10 years agoDocumentation/git-config: fix --get-all description
John Keeping [Sun, 28 Feb 2016 11:54:37 +0000 (11:54 +0000)]
Documentation/git-config: fix --get-all description

--get does not fail if a key is multi-valued, it returns the last value
as described in its documentation.  Clarify the description of --get-all
to avoid implying that --get does fail in this case.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoDocumentation/git-config: use bulleted list for exit codes
John Keeping [Sun, 28 Feb 2016 11:54:36 +0000 (11:54 +0000)]
Documentation/git-config: use bulleted list for exit codes

Using a numbered list is confusing because the exit codes are not listed
in order so the numbers at the start of each line do not match the exit
codes described by the following text.  Switch to a bulleted list so
that the only number appearing on each line is the exit code described.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoconfig: fail if --get-urlmatch finds no value
John Keeping [Sun, 28 Feb 2016 11:54:35 +0000 (11:54 +0000)]
config: fail if --get-urlmatch finds no value

The --get, --get-all and --get-regexp options to git-config exit with
status 1 if the key is not found but --get-urlmatch succeeds in this
case.

Change --get-urlmatch to behave in the same way as the other --get*
options so that all four are consistent.  --get-color is a special case
because it accepts a default value to return and so should not return an
error if the key is not found.

Also clarify this behaviour in the documentation.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>