]> git.neil.brown.name Git - git.git/log
git.git
7 years agoGit 2.6.7 v2.6.7
Junio C Hamano [Fri, 5 May 2017 03:56:19 +0000 (12:56 +0900)]
Git 2.6.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'maint-2.5' into maint-2.6
Junio C Hamano [Fri, 5 May 2017 03:52:26 +0000 (12:52 +0900)]
Merge branch 'maint-2.5' into maint-2.6

7 years agoGit 2.5.6 v2.5.6
Junio C Hamano [Fri, 5 May 2017 03:49:00 +0000 (12:49 +0900)]
Git 2.5.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'maint-2.4' into maint-2.5
Junio C Hamano [Fri, 5 May 2017 03:46:53 +0000 (12:46 +0900)]
Merge branch 'maint-2.4' into maint-2.5

7 years agoGit 2.4.12 v2.4.12
Junio C Hamano [Fri, 5 May 2017 03:25:09 +0000 (12:25 +0900)]
Git 2.4.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4
Junio C Hamano [Fri, 5 May 2017 03:17:55 +0000 (12:17 +0900)]
Merge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4

* jk/shell-no-repository-that-begins-with-dash:
  shell: disallow repo names beginning with dash

7 years agoshell: disallow repo names beginning with dash
Jeff King [Sat, 29 Apr 2017 12:36:44 +0000 (08:36 -0400)]
shell: disallow repo names beginning with dash

When a remote server uses git-shell, the client side will
connect to it like:

  ssh server "git-upload-pack 'foo.git'"

and we literally exec ("git-upload-pack", "foo.git"). In
early versions of upload-pack and receive-pack, we took a
repository argument and nothing else. But over time they
learned to accept dashed options. If the user passes a
repository name that starts with a dash, the results are
confusing at best (we complain of a bogus option instead of
a non-existent repository) and malicious at worst (the user
can start an interactive pager via "--help").

We could pass "--" to the sub-process to make sure the
user's argument is interpreted as a branch name. I.e.:

  git-upload-pack -- -foo.git

But adding "--" automatically would make us inconsistent
with a normal shell (i.e., when git-shell is not in use),
where "-foo.git" would still be an error. For that case, the
client would have to specify the "--", but they can't do so
reliably, as existing versions of git-shell do not allow
more than a single argument.

The simplest thing is to simply disallow "-" at the start of
the repo name argument. This hasn't worked either with or
without git-shell since version 1.0.0, and nobody has
complained.

Note that this patch just applies to do_generic_cmd(), which
runs upload-pack, receive-pack, and upload-archive. There
are two other types of commands that git-shell runs:

  - do_cvs_cmd(), but this already restricts the argument to
    be the literal string "server"

  - admin-provided commands in the git-shell-commands
    directory. We'll pass along arbitrary arguments there,
    so these commands could have similar problems. But these
    commands might actually understand dashed arguments, so
    we cannot just block them here. It's up to the writer of
    the commands to make sure they are safe. With great
    power comes great responsibility.

Reported-by: Timo Schmid <tschmid@ernw.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.6.6 v2.6.6
Junio C Hamano [Thu, 17 Mar 2016 17:56:06 +0000 (10:56 -0700)]
Git 2.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'maint-2.5' into maint-2.6
Junio C Hamano [Thu, 17 Mar 2016 18:26:18 +0000 (11:26 -0700)]
Merge branch 'maint-2.5' into maint-2.6

* maint-2.5:
  Git 2.5.5
  Git 2.4.11
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
  tree-diff: catch integer overflow in combine_diff_path allocation
  add helpers for detecting size_t overflow

8 years agoGit 2.5.5 v2.5.5
Junio C Hamano [Thu, 17 Mar 2016 17:28:50 +0000 (10:28 -0700)]
Git 2.5.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'maint-2.4' into maint-2.5
Junio C Hamano [Thu, 17 Mar 2016 18:24:14 +0000 (11:24 -0700)]
Merge branch 'maint-2.4' into maint-2.5

* maint-2.4:
  Git 2.4.11
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
  tree-diff: catch integer overflow in combine_diff_path allocation
  add helpers for detecting size_t overflow

8 years agoGit 2.4.11 v2.4.11
Junio C Hamano [Thu, 17 Mar 2016 17:00:44 +0000 (10:00 -0700)]
Git 2.4.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jk/path-name-safety-2.4' into maint-2.4
Junio C Hamano [Thu, 17 Mar 2016 16:55:54 +0000 (09:55 -0700)]
Merge branch 'jk/path-name-safety-2.4' into maint-2.4

Bugfix patches were backported from the 'master' front to plug heap
corruption holes, to catch integer overflow in the computation of
pathname lengths, and to get rid of the name_path API.  Both of
these would have resulted in writing over an under-allocated buffer
when formulating pathnames while tree traversal.

* jk/path-name-safety-2.4:
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
  tree-diff: catch integer overflow in combine_diff_path allocation
  add helpers for detecting size_t overflow

8 years agolist-objects: pass full pathname to callbacks
Jeff King [Thu, 11 Feb 2016 22:28:36 +0000 (17:28 -0500)]
list-objects: pass full pathname to callbacks

When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and we could
simply append "c" to it temporarily, then roll back the
length, without creating a new copy.

So we could improve this by teaching the callsites of
path_name() this trick (and there are only 3). But we can
also notice that no callback actually cares about the
broken-down representation, and simply pass each callback
the full path "a/b/c" as a string. The callback code becomes
even simpler, then, as we do not have to worry about freeing
an allocated buffer, nor rolling back our modification to
the strbuf.

This is theoretically less efficient, as some callbacks
would not bother to format the final path component. But in
practice this is not measurable. Since we use the same
strbuf over and over, our work to grow it is amortized, and
we really only pay to memcpy a few bytes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agolist-objects: drop name_path entirely
Jeff King [Thu, 11 Feb 2016 22:26:44 +0000 (17:26 -0500)]
list-objects: drop name_path entirely

In the previous commit, we left name_path as a thin wrapper
around a strbuf. This patch drops it entirely. As a result,
every show_object_fn callback needs to be adjusted. However,
none of their code needs to be changed at all, because the
only use was to pass it to path_name(), which now handles
the bare strbuf.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agolist-objects: convert name_path to a strbuf
Jeff King [Thu, 11 Feb 2016 22:26:18 +0000 (17:26 -0500)]
list-objects: convert name_path to a strbuf

The "struct name_path" data is examined in only two places:
we generate it in process_tree(), and we convert it to a
single string in path_name(). Everyone else just passes it
through to those functions.

We can further note that process_tree() already keeps a
single strbuf with the leading tree path, for use with
tree_entry_interesting().

Instead of building a separate name_path linked list, let's
just use the one we already build in "base". This reduces
the amount of code (especially tricky code in path_name()
which did not check for integer overflows caused by deep
or large pathnames).

It is also more efficient in some instances.  Any time we
were using tree_entry_interesting, we were building up the
strbuf anyway, so this is an immediate and obvious win
there. In cases where we were not, we trade off storing
"pathname/" in a strbuf on the heap for each level of the
path, instead of two pointers and an int on the stack (with
one pointer into the tree object). On a 64-bit system, the
latter is 20 bytes; so if path components are less than that
on average, this has lower peak memory usage.  In practice
it probably doesn't matter either way; we are already
holding in memory all of the tree objects leading up to each
pathname, and for normal-depth pathnames, we are only
talking about hundreds of bytes.

This patch leaves "struct name_path" as a thin wrapper
around the strbuf, to avoid disrupting callbacks. We should
fix them, but leaving it out makes this diff easier to view.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoshow_object_with_name: simplify by using path_name()
Jeff King [Thu, 11 Feb 2016 22:24:18 +0000 (17:24 -0500)]
show_object_with_name: simplify by using path_name()

When "git rev-list" shows an object with its associated path
name, it does so by walking the name_path linked list and
printing each component (stopping at any embedded NULs or
newlines).

We'd like to eventually get rid of name_path entirely in
favor of a single buffer, and dropping this custom printing
code is part of that. As a first step, let's use path_name()
to format the list into a single buffer, and print that.
This is strictly less efficient than the original, but it's
a temporary step in the refactoring; our end game will be to
get the fully formatted name in the first place.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agohttp-push: stop using name_path
Jeff King [Thu, 11 Feb 2016 22:23:48 +0000 (17:23 -0500)]
http-push: stop using name_path

The graph traversal code here passes along a name_path to
build up the pathname at which we find each blob. But we
never actually do anything with the resulting names, making
it a waste of code and memory.

This usage came in aa1dbc9 (Update http-push functionality,
2006-03-07), and originally the result was passed to
"add_object" (which stored it, but didn't really use it,
either). But we stopped using that function in 1f1e895 (Add
"named object array" concept, 2006-06-19) in favor of
storing just the objects themselves.

Moreover, the generation of the name in process_tree() is
buggy. It sticks "name" onto the end of the name_path linked
list, and then passes it down again as it recurses (instead
of "entry.path"). So it's a good thing this was unused, as
the resulting path for "a/b/c/d" would end up as "a/a/a/a".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotree-diff: catch integer overflow in combine_diff_path allocation
Jeff King [Fri, 19 Feb 2016 11:21:30 +0000 (06:21 -0500)]
tree-diff: catch integer overflow in combine_diff_path allocation

A combine_diff_path struct has two "flex" members allocated
alongside the struct: a string to hold the pathname, and an
array of parent pointers. We use an "int" to compute this,
meaning we may easily overflow it if the pathname is
extremely long.

We can fix this by using size_t, and checking for overflow
with the st_add helper.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoadd helpers for detecting size_t overflow
Jeff King [Fri, 19 Feb 2016 11:21:19 +0000 (06:21 -0500)]
add helpers for detecting size_t overflow

Performing computations on size_t variables that we feed to
xmalloc and friends can be dangerous, as an integer overflow
can cause us to allocate a much smaller chunk than we
realized.

We already have unsigned_add_overflows(), but let's add
unsigned_mult_overflows() to that. Furthermore, rather than
have each site manually check and die on overflow, we can
provide some helpers that will:

  - promote the arguments to size_t, so that we know we are
    doing our computation in the same size of integer that
    will ultimately be fed to xmalloc

  - check and die on overflow

  - return the result so that computations can be done in
    the parameter list of xmalloc.

These functions are a lot uglier to use than normal
arithmetic operators (you have to do "st_add(foo, bar)"
instead of "foo + bar"). To at least limit the damage, we
also provide multi-valued versions. So rather than:

  st_add(st_add(a, b), st_add(c, d));

you can write:

  st_add4(a, b, c, d);

This isn't nearly as elegant as a varargs function, but it's
a lot harder to get it wrong. You don't have to remember to
add a sentinel value at the end, and the compiler will
complain if you get the number of arguments wrong. This
patch adds only the numbered variants required to convert
the current code base; we can easily add more later if
needed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.6.5 v2.6.5
Junio C Hamano [Mon, 4 Jan 2016 22:06:00 +0000 (14:06 -0800)]
Git 2.6.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jk/pending-keep-tag-name' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:03:07 +0000 (14:03 -0800)]
Merge branch 'jk/pending-keep-tag-name' into maint

History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
  revision.c: propagate tag names from pending array

8 years agoMerge branch 'jk/symbolic-ref-maint' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:58 +0000 (14:02 -0800)]
Merge branch 'jk/symbolic-ref-maint' into maint

"git symbolic-ref" forgot to report a failure with its exit status.

* jk/symbolic-ref-maint:
  t1401: test reflog creation for git-symbolic-ref
  symbolic-ref: propagate error code from create_symref()

8 years agoMerge branch 'jk/ident-loosen-getpwuid' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:57 +0000 (14:02 -0800)]
Merge branch 'jk/ident-loosen-getpwuid' into maint

When getpwuid() on the system returned NULL (e.g. the user is not
in the /etc/passwd file or other uid-to-name mappings), the
codepath to find who the user is to record it in the reflog barfed
and died.  Loosen the check in this codepath, which already accepts
questionable ident string (e.g. host part of the e-mail address is
obviously bogus), and in general when we operate fmt_ident() function
in non-strict mode.

* jk/ident-loosen-getpwuid:
  ident: loosen getpwuid error in non-strict mode
  ident: keep a flag for bogus default_email
  ident: make xgetpwuid_self() a static local helper

8 years agoMerge branch 'jk/send-email-ssl-errors' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:55 +0000 (14:02 -0800)]
Merge branch 'jk/send-email-ssl-errors' into maint

Improve error reporting when SMTP TLS fails.

* jk/send-email-ssl-errors:
  send-email: enable SSL level 1 debug output

8 years agoMerge branch 'sg/completion-no-column' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:45 +0000 (14:02 -0800)]
Merge branch 'sg/completion-no-column' into maint

The completion script (in contrib/) used to list "git column"
(which is not an end-user facing command) as one of the choices

* sg/completion-no-column:
  completion: remove 'git column' from porcelain commands

8 years agot1401: test reflog creation for git-symbolic-ref
Jeff King [Sun, 20 Dec 2015 07:27:23 +0000 (02:27 -0500)]
t1401: test reflog creation for git-symbolic-ref

The current code writes a reflog entry whenever we update a
symbolic ref, but we never test that this is so. Let's add a
test to make sure upcoming refactoring doesn't cause a
regression.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosymbolic-ref: propagate error code from create_symref()
Jeff King [Sun, 20 Dec 2015 07:27:18 +0000 (02:27 -0500)]
symbolic-ref: propagate error code from create_symref()

If create_symref() fails, git-symbolic-ref will still exit
with code 0, and our caller has no idea that the command did
nothing.

This appears to have been broken since the beginning of time
(e.g., it is not a regression where create_symref() stopped
calling die() or something similar).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorevision.c: propagate tag names from pending array
Jeff King [Thu, 17 Dec 2015 06:47:07 +0000 (01:47 -0500)]
revision.c: propagate tag names from pending array

When we unwrap a tag to find its commit for a traversal, we
do not propagate the "name" field of the tag in the pending
array (i.e., the ref name the user gave us in the first
place) to the commit (instead, we use an empty string). This
means that "git log --source" will never show the tag-name
for commits we reach through it.

This was broken in 2073949 (traverse_commit_list: support
pending blobs/trees with paths, 2014-10-15). That commit
tried to be careful and avoid propagating the path
information for a tag (which would be nonsensical) to trees
and blobs. But it should not have cut off the "name" field,
which should carry forward to children.

Note that this does mean that the "name" field will carry
forward to blobs and trees, too. Whereas prior to 2073949,
we always gave them an empty string. This is the right thing
to do, but in practice no callers probably use it (since now
we have an explicit separate "path" field, which was the
point of 2073949).

We add tests here not only for the broken case, but also a
basic sanity test of "log --source" in general, which did
not have any coverage in the test suite.

Reported-by: Raymundo <gypark@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'sg/lock-file-commit-error' into maint
Junio C Hamano [Wed, 16 Dec 2015 18:27:22 +0000 (10:27 -0800)]
Merge branch 'sg/lock-file-commit-error' into maint

* sg/lock-file-commit-error:
  credential-store: don't pass strerror to die_errno()

8 years agocredential-store: don't pass strerror to die_errno()
SZEDER Gábor [Wed, 16 Dec 2015 11:22:55 +0000 (12:22 +0100)]
credential-store: don't pass strerror to die_errno()

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoUpdate draft release notes to 2.6.5
Junio C Hamano [Tue, 15 Dec 2015 17:43:01 +0000 (09:43 -0800)]
Update draft release notes to 2.6.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'dt/fsck-verify-pack-error' into maint
Junio C Hamano [Tue, 15 Dec 2015 17:42:16 +0000 (09:42 -0800)]
Merge branch 'dt/fsck-verify-pack-error' into maint

The exit code of git-fsck didnot reflect some types of errors found
in packed objects, which has been corrected.

* dt/fsck-verify-pack-error:
  verify_pack: do not ignore return value of verification function

8 years agoMerge branch 'ep/ident-with-getaddrinfo' into maint
Junio C Hamano [Tue, 15 Dec 2015 17:42:01 +0000 (09:42 -0800)]
Merge branch 'ep/ident-with-getaddrinfo' into maint

A fix-up for recent topic.

* ep/ident-with-getaddrinfo:
  ident: fix undefined variable when NO_IPV6 is set
  ident.c: add support for IPv6

8 years agoMerge branch 'ls/p4-keep-empty-commits' into maint
Junio C Hamano [Tue, 15 Dec 2015 17:34:18 +0000 (09:34 -0800)]
Merge branch 'ls/p4-keep-empty-commits' into maint

"git p4" used to import Perforce CLs that touch only paths outside
the client spec as empty commits.  It has been corrected to ignore
them instead, with a new configuration git-p4.keepEmptyCommits as a
backward compatibility knob.

* ls/p4-keep-empty-commits:
  git-p4: add option to keep empty commits

8 years agoMerge branch 'jk/prune-mtime' into maint
Junio C Hamano [Tue, 15 Dec 2015 17:27:11 +0000 (09:27 -0800)]
Merge branch 'jk/prune-mtime' into maint

The helper used to iterate over loose object directories to prune
stale objects did not closedir() immediately when it is done with a
directory--a callback such as the one used for "git prune" may want
to do rmdir(), but it would fail on open directory on platforms
such as WinXP.

* jk/prune-mtime:
  prune: close directory earlier during loose-object directory traversal

8 years agoident: fix undefined variable when NO_IPV6 is set
Jeff King [Mon, 14 Dec 2015 20:52:41 +0000 (15:52 -0500)]
ident: fix undefined variable when NO_IPV6 is set

Commit 00bce77 (ident.c: add support for IPv6, 2015-11-27)
moved the "gethostbyname" call out of "add_domainname" and
into the helper function "canonical_name". But when moving
the code, it forgot that the "buf" variable is passed as
"host" in the helper.

Reported-by: johan defries <johandefries@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoident: loosen getpwuid error in non-strict mode
Jeff King [Thu, 10 Dec 2015 21:41:29 +0000 (16:41 -0500)]
ident: loosen getpwuid error in non-strict mode

If the user has not specified an identity and we have to
turn to getpwuid() to find the username or gecos field, we
die immediately when getpwuid fails (e.g., because the user
does not exist). This is OK for making a commit, where we
have set IDENT_STRICT and would want to bail on bogus input.

But for something like a reflog, where the ident is "best
effort", it can be pain. For instance, even running "git
clone" with a UID that is not in /etc/passwd will result in
git barfing, just because we can't find an ident to put in
the reflog.

Instead of dying in xgetpwuid_self, we can instead return a
fallback value, and set a "bogus" flag. For the username in
an email, we already have a "default_email_is_bogus" flag.
For the name field, we introduce (and check) a matching
"default_name_is_bogus" flag. As a bonus, this means you now
get the usual "tell me who you are" advice instead of just a
"no such user" error.

No tests, as this is dependent on configuration outside of
git's control. However, I did confirm that it behaves
sensibly when I delete myself from the local /etc/passwd
(reflogs get written, and commits complain).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocompletion: remove 'git column' from porcelain commands
SZEDER Gábor [Fri, 11 Dec 2015 12:05:00 +0000 (13:05 +0100)]
completion: remove 'git column' from porcelain commands

'git column' is an internal helper, so it should not be offered on
'git <TAB>' along with porcelain commands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoPrepare for 2.6.5
Junio C Hamano [Fri, 11 Dec 2015 19:17:47 +0000 (11:17 -0800)]
Prepare for 2.6.5

This back-merges hopefully the last batch of trivially correct fixes
to the 2.6.x maintenance track from the master branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'sn/null-pointer-arith-in-mark-tree-uninteresting' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:38 +0000 (11:14 -0800)]
Merge branch 'sn/null-pointer-arith-in-mark-tree-uninteresting' into maint

mark_tree_uninteresting() has code to handle the case where it gets
passed a NULL pointer in its 'tree' parameter, but the function had
'object = &tree->object' assignment before checking if tree is
NULL.  This gives a compiler an excuse to declare that tree will
never be NULL and apply a wrong optimization.  Avoid it.

* sn/null-pointer-arith-in-mark-tree-uninteresting:
  revision.c: fix possible null pointer arithmetic

8 years agoMerge branch 'sg/lock-file-commit-error' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:18 +0000 (11:14 -0800)]
Merge branch 'sg/lock-file-commit-error' into maint

Cosmetic improvement to lock-file error messages.

* sg/lock-file-commit-error:
  Make error message after failing commit_lock_file() less confusing

8 years agoMerge branch 'cb/t3404-shellquote' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:18 +0000 (11:14 -0800)]
Merge branch 'cb/t3404-shellquote' into maint

* cb/t3404-shellquote:
  t3404: fix quoting of redirect for some versions of bash

8 years agoMerge branch 'sb/doc-submodule-sync-recursive' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:17 +0000 (11:14 -0800)]
Merge branch 'sb/doc-submodule-sync-recursive' into maint

* sb/doc-submodule-sync-recursive:
  document submodule sync --recursive

8 years agoMerge branch 'nd/doc-check-ref-format-typo' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:15 +0000 (11:14 -0800)]
Merge branch 'nd/doc-check-ref-format-typo' into maint

* nd/doc-check-ref-format-typo:
  git-check-ref-format.txt: typo, s/avoids/avoid/

8 years agoMerge branch 'rs/show-branch-argv-array' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:13 +0000 (11:14 -0800)]
Merge branch 'rs/show-branch-argv-array' into maint

Code simplification.

* rs/show-branch-argv-array:
  show-branch: use argv_array for default arguments

8 years agoMerge branch 'rs/pop-commit' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:12 +0000 (11:14 -0800)]
Merge branch 'rs/pop-commit' into maint

Code simplification.

* rs/pop-commit:
  use pop_commit() for consuming the first entry of a struct commit_list

8 years agoMerge branch 'as/subtree-with-spaces' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:11 +0000 (11:14 -0800)]
Merge branch 'as/subtree-with-spaces' into maint

Update "git subtree" (in contrib/) so that it can take whitespaces
in the pathnames, not only in the in-tree pathname but the name of
the directory that the repository is in.

* as/subtree-with-spaces:
  contrib/subtree: respect spaces in a repository path
  t7900-subtree: test the "space in a subdirectory name" case

8 years agoMerge branch 'jk/test-lint-forbid-when-finished-in-subshell' into maint
Junio C Hamano [Fri, 11 Dec 2015 19:14:09 +0000 (11:14 -0800)]
Merge branch 'jk/test-lint-forbid-when-finished-in-subshell' into maint

Because "test_when_finished" in our test framework queues the
clean-up tasks to be done in a shell variable, it should not be
used inside a subshell.  Add a mechanism to allow 'bash' to catch
such uses, and fix the ones that were found.

* jk/test-lint-forbid-when-finished-in-subshell:
  test-lib-functions: detect test_when_finished in subshell
  t7800: don't use test_config in a subshell
  test-lib-functions: support "test_config -C <dir> ..."
  t5801: don't use test_when_finished in a subshell
  t7610: don't use test_config in a subshell

8 years agosend-email: enable SSL level 1 debug output
John Keeping [Thu, 3 Dec 2015 21:47:18 +0000 (21:47 +0000)]
send-email: enable SSL level 1 debug output

If a server's certificate isn't accepted by send-email, the output is:

Unable to initialize SMTP properly. Check config and use --smtp-debug.

but adding --smtp-debug=1 just produces the same output since we don't
get as far as talking SMTP.

Turning on SSL debug at level 1 gives:

DEBUG: .../IO/Socket/SSL.pm:1796: SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:673: fatal SSL error: SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:1780: IO::Socket::IP configuration failed

IO::Socket::SSL defines level 1 debug as "print out errors from
IO::Socket::SSL and ciphers from Net::SSLeay".  In fact, it aliases
Net::SSLeay::trace which is defined to guarantee silence at level 0 and
only emit error messages at level 1, so let's enable it by default.

The modification of warnings is needed to avoid a warning about:

Name "IO::Socket::SSL::DEBUG" used only once: possible typo

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoident: keep a flag for bogus default_email
Jeff King [Thu, 10 Dec 2015 21:35:36 +0000 (16:35 -0500)]
ident: keep a flag for bogus default_email

If we have to deduce the user's email address and can't come
up with something plausible for the hostname, we simply
write "(none)" or ".(none)" in the hostname.

Later, our strict-check is forced to use strstr to look for
this magic string. This is probably not a problem in
practice, but it's rather ugly. Let's keep an extra flag
that tells us the email is bogus, and check that instead.

We could get away with simply setting the global in
add_domainname(); it only gets called to write into
git_default_email. However, let's make the code a little
more obvious to future readers by actually passing a pointer
to our "bogus" flag down the call-chain.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoident: make xgetpwuid_self() a static local helper
Jeff King [Thu, 10 Dec 2015 21:33:05 +0000 (16:33 -0500)]
ident: make xgetpwuid_self() a static local helper

This function is defined in wrapper.c, but nobody besides
ident.c uses it. And nobody is likely to in the future,
either, as anything that cares about the user's name should
be going through the ident code.

Moving it here is a cleanup of the global namespace, but it
will also enable further cleanups inside ident.c.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation/git-update-index: add missing opts to synopsis
Christian Couder [Wed, 25 Nov 2015 09:30:02 +0000 (10:30 +0100)]
Documentation/git-update-index: add missing opts to synopsis

Split index related options should appear in the 'SYNOPSIS'
section.

These options are already documented in the 'OPTIONS' section.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit-p4: add option to keep empty commits
Lars Schneider [Tue, 8 Dec 2015 09:36:22 +0000 (10:36 +0100)]
git-p4: add option to keep empty commits

A changelist that contains only excluded files due to a client spec was
imported as an empty commit. Fix that issue by ignoring these commits.
Add option "git-p4.keepEmptyCommits" to make the previous behavior
available.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Helped-by: Pete Harlan
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.6.4 v2.6.4
Junio C Hamano [Tue, 8 Dec 2015 22:07:30 +0000 (14:07 -0800)]
Git 2.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'rs/status-detached-head-memcmp' into maint
Junio C Hamano [Tue, 8 Dec 2015 22:11:32 +0000 (14:11 -0800)]
Merge branch 'rs/status-detached-head-memcmp' into maint

Fix some string-matching corner cases when digging in the reflog for
"git status".

* rs/status-detached-head-memcmp:
  wt-status: correct and simplify check for detached HEAD

8 years agoMerge branch 'ad/sha1-update-chunked' into maint
Junio C Hamano [Tue, 8 Dec 2015 22:05:03 +0000 (14:05 -0800)]
Merge branch 'ad/sha1-update-chunked' into maint

Apple's common crypto implementation of SHA1_Update() does not take
more than 4GB at a time, and we now have a compile-time workaround
for it.

* ad/sha1-update-chunked:
  sha1: allow limiting the size of the data passed to SHA1_Update()
  sha1: provide another level of indirection for the SHA-1 functions

8 years agoMerge branch 'sg/bash-prompt-dirty-orphan' into maint
Junio C Hamano [Tue, 8 Dec 2015 22:05:02 +0000 (14:05 -0800)]
Merge branch 'sg/bash-prompt-dirty-orphan' into maint

Produce correct "dirty" marker for shell prompts, even when we
are on an orphan or an unborn branch.

* sg/bash-prompt-dirty-orphan:
  bash prompt: indicate dirty index even on orphan branches
  bash prompt: remove a redundant 'git diff' option
  bash prompt: test dirty index and worktree while on an orphan branch

8 years agoMerge branch 'jk/interpret-trailers-outside-a-repository' into maint
Junio C Hamano [Tue, 8 Dec 2015 22:05:02 +0000 (14:05 -0800)]
Merge branch 'jk/interpret-trailers-outside-a-repository' into maint

Allow "git interpret-trailers" to run outside of a Git repository.

* jk/interpret-trailers-outside-a-repository:
  interpret-trailers: allow running outside a repository

8 years agoMerge branch 'jk/rebase-no-autostash' into maint
Junio C Hamano [Tue, 8 Dec 2015 22:05:00 +0000 (14:05 -0800)]
Merge branch 'jk/rebase-no-autostash' into maint

There was no way to defeat a configured rebase.autostash variable
from the command line, as "git rebase --no-autostash" was missing.

* jk/rebase-no-autostash:
  Documentation/git-rebase: fix --no-autostash formatting
  rebase: support --no-autostash

8 years agorevision.c: fix possible null pointer arithmetic
Stefan Naewe [Sat, 5 Dec 2015 15:27:24 +0000 (16:27 +0100)]
revision.c: fix possible null pointer arithmetic

mark_tree_uninteresting() dereferences a tree pointer before
checking if the pointer is valid. Fix that by doing the check first.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot3404: fix quoting of redirect for some versions of bash
Charles Bailey [Wed, 2 Dec 2015 20:50:07 +0000 (20:50 +0000)]
t3404: fix quoting of redirect for some versions of bash

As CodingGuidelines says, some versions of bash errors out when
$variable substitution is used as the target for redirection without
being quoted (even though POSIX may not require such a quote).

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit-check-ref-format.txt: typo, s/avoids/avoid/
Nguyễn Thái Ngọc Duy [Fri, 4 Dec 2015 18:09:32 +0000 (19:09 +0100)]
git-check-ref-format.txt: typo, s/avoids/avoid/

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodocument submodule sync --recursive
Stefan Beller [Thu, 3 Dec 2015 20:41:02 +0000 (12:41 -0800)]
document submodule sync --recursive

The git-submodule(1) is inconsistent. In the synopsis, it says:

       git submodule [--quiet] sync [--recursive] [--] [<path>...]

The description of the sync does not mention --recursive, and the
description of --recursive says that it is only available for foreach,
update and status.

The option was introduced (82f49f294c, Teach --recursive to submodule
sync, 2012-10-26) a while ago, so let's document it, too.

Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoPrepare for 2.6.4
Junio C Hamano [Fri, 4 Dec 2015 19:39:19 +0000 (11:39 -0800)]
Prepare for 2.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'da/difftool' into maint
Junio C Hamano [Fri, 4 Dec 2015 19:34:24 +0000 (11:34 -0800)]
Merge branch 'da/difftool' into maint

The code to prepare the working tree side of temporary directory
for the "dir-diff" feature forgot that symbolic links need not be
copied (or symlinked) to the temporary area, as the code already
special cases and overwrites them.  Besides, it was wrong to try
computing the object name of the target of symbolic link, which may
not even exist or may be a directory.

* da/difftool:
  difftool: ignore symbolic links in use_wt_file

8 years agoMerge branch 'dk/gc-idx-wo-pack' into maint
Junio C Hamano [Fri, 4 Dec 2015 19:33:07 +0000 (11:33 -0800)]
Merge branch 'dk/gc-idx-wo-pack' into maint

Having a leftover .idx file without corresponding .pack file in
the repository hurts performance; "git gc" learned to prune them.

We may want to do the same for .bitmap (and notice but not prune
.keep) without corresponding .pack, but that can be a separate
topic.

* dk/gc-idx-wo-pack:
  gc: remove garbage .idx files from pack dir
  t5304: test cleaning pack garbage
  prepare_packed_git(): refactor garbage reporting in pack directory

8 years agoverify_pack: do not ignore return value of verification function
David Turner [Mon, 30 Nov 2015 22:47:42 +0000 (17:47 -0500)]
verify_pack: do not ignore return value of verification function

In verify_pack, a caller-supplied verification function is called.
The function returns an int.  If that return value is non-zero,
verify_pack should fail.

The only caller of verify_pack is in builtin/fsck.c, whose verify_fn
returns a meaningful error code (which was then ignored).  Now, fsck
might return a different error code (with more detail).  This would
happen in the unlikely event that a commit or tree that is a valid git
object but not a valid instance of its type gets into a pack.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoMake error message after failing commit_lock_file() less confusing
SZEDER Gábor [Mon, 30 Nov 2015 11:40:53 +0000 (12:40 +0100)]
Make error message after failing commit_lock_file() less confusing

The error message after a failing commit_lock_file() call sometimes
looks like this, causing confusion:

  $ git remote add remote git@server.com/repo.git
  error: could not commit config file .git/config
  # Huh?!
  # I didn't want to commit anything, especially not my config file!

While in the narrow context of the lockfile module using the verb
'commit' in the error message makes perfect sense, in the broader
context of git the word 'commit' already has a very specific meaning,
hence the confusion.

Reword these error messages to say "could not write" instead of "could
not commit".

While at it, include strerror in the error messages after writing the
config file or the credential store fails to provide some information
about the cause of the failure, and update the style of the error
message after writing the reflog fails to match surrounding error
messages (i.e. no '' around the pathname and no () around the error
description).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoMerge branch 'eg/p4-submit-catch-failure' into maint
Jeff King [Tue, 1 Dec 2015 22:24:20 +0000 (17:24 -0500)]
Merge branch 'eg/p4-submit-catch-failure' into maint

Just like the working tree is cleaned up when the user cancelled
submission in P4Submit.applyCommit(), clean up the mess if "p4
submit" fails.

* eg/p4-submit-catch-failure:
  git-p4: clean up after p4 submit failure

8 years agoMerge branch 'dk/check-ignore-docs' into maint
Jeff King [Tue, 1 Dec 2015 22:21:31 +0000 (17:21 -0500)]
Merge branch 'dk/check-ignore-docs' into maint

Documentation clarification for "check-ignore" without "--verbose".

* dk/check-ignore-docs:
  check-ignore: correct documentation about output

8 years agoMerge branch 'ld/p4-detached-head' into maint
Jeff King [Tue, 1 Dec 2015 22:21:29 +0000 (17:21 -0500)]
Merge branch 'ld/p4-detached-head' into maint

Make git-p4 work on a detached head.

* ld/p4-detached-head:
  git-p4: work with a detached head
  git-p4: add option to system() to return subshell status
  git-p4: add failing test for submit from detached head

8 years agoMerge branch 'sg/filter-branch-dwim-ambiguity' into maint
Jeff King [Tue, 1 Dec 2015 22:21:17 +0000 (17:21 -0500)]
Merge branch 'sg/filter-branch-dwim-ambiguity' into maint

Fix for a corner case in filter-branch.

* sg/filter-branch-dwim-ambiguity:
  filter-branch: deal with object name vs. pathname ambiguity in tree-filter

8 years agoMerge branch 'mg/doc-word-diff-example' into maint
Jeff King [Tue, 1 Dec 2015 22:21:11 +0000 (17:21 -0500)]
Merge branch 'mg/doc-word-diff-example' into maint

* mg/doc-word-diff-example:
  Documentation/diff: give --word-diff-regex=. example

8 years agoMerge branch 'cb/ssl-config-pathnames' into maint
Jeff King [Tue, 1 Dec 2015 22:21:01 +0000 (17:21 -0500)]
Merge branch 'cb/ssl-config-pathnames' into maint

Allow tilde-expansion in some http config variables.

* cb/ssl-config-pathnames:
  http: treat config options sslCAPath and sslCAInfo as paths

8 years agoMerge branch 'dk/t5813-unc-paths' into maint
Jeff King [Tue, 1 Dec 2015 22:20:52 +0000 (17:20 -0500)]
Merge branch 'dk/t5813-unc-paths' into maint

Test portability fix for a topic in v2.6.1.

* dk/t5813-unc-paths:
  t5813: avoid creating urls that break on cygwin

8 years agoMerge branch 'dk/rerere-train-quoting' into maint
Jeff King [Tue, 1 Dec 2015 22:20:46 +0000 (17:20 -0500)]
Merge branch 'dk/rerere-train-quoting' into maint

Fix shell quoting in contrib script.

* dk/rerere-train-quoting:
  Escape Git's exec path in contrib/rerere-train.sh script

8 years agoMerge branch 'cb/hook-sigpipe' into maint
Jeff King [Tue, 1 Dec 2015 22:19:52 +0000 (17:19 -0500)]
Merge branch 'cb/hook-sigpipe' into maint

We now consistently allow all hooks to ignore their standard input,
rather than having git complain of SIGPIPE.

* cb/hook-sigpipe:
  allow hooks to ignore their standard input stream

8 years agoMerge branch 'fm/shell-path-whitespace' into maint
Jeff King [Tue, 1 Dec 2015 22:19:37 +0000 (17:19 -0500)]
Merge branch 'fm/shell-path-whitespace' into maint

Portability fix for Windows, which may rewrite $SHELL variable using
non-POSIX paths.

* fm/shell-path-whitespace:
  rebase-i-exec: Allow space in SHELL_PATH

8 years agoMerge branch 'ar/doc-env-variable-format' into maint
Jeff King [Tue, 1 Dec 2015 22:19:33 +0000 (17:19 -0500)]
Merge branch 'ar/doc-env-variable-format' into maint

Minor documentation fixup.

* ar/doc-env-variable-format:
  Documentation: make environment variable formatting more consistent

8 years agoMerge branch 'pt/http-socks-proxy' into maint
Jeff King [Tue, 1 Dec 2015 22:19:12 +0000 (17:19 -0500)]
Merge branch 'pt/http-socks-proxy' into maint

Add support for talking http/https over socks proxy.

* pt/http-socks-proxy:
  remote-http(s): support SOCKS proxies

8 years agoMerge branch 'rc/configure-use-libs-when-checking-a-lib' into maint
Jeff King [Tue, 1 Dec 2015 22:19:06 +0000 (17:19 -0500)]
Merge branch 'rc/configure-use-libs-when-checking-a-lib' into maint

The "configure" script did not test for -lpthread correctly, which
upset some linkers.

* rc/configure-use-libs-when-checking-a-lib:
  configure.ac: use $LIBS not $CFLAGS when testing -lpthread

8 years agowt-status: correct and simplify check for detached HEAD
René Scharfe [Wed, 25 Nov 2015 14:10:18 +0000 (15:10 +0100)]
wt-status: correct and simplify check for detached HEAD

If a branch name is longer than four characters then memcmp() reads over
the end of the static string "HEAD".  This causes the following test
failures with AddressSanitizer:

t3203-branch-output.sh                           (Wstat: 256 Tests: 18 Failed: 4)
  Failed tests:  12, 15-17
  Non-zero exit status: 1
t3412-rebase-root.sh                             (Wstat: 256 Tests: 31 Failed: 3)
  Failed tests:  28-29, 31
  Non-zero exit status: 1
t3507-cherry-pick-conflict.sh                    (Wstat: 256 Tests: 31 Failed: 4)
  Failed tests:  14, 29-31
  Non-zero exit status: 1
t3510-cherry-pick-sequence.sh                    (Wstat: 256 Tests: 39 Failed: 14)
  Failed tests:  17, 22-26, 28-30, 34-35, 37-39
  Non-zero exit status: 1
t3420-rebase-autostash.sh                        (Wstat: 256 Tests: 28 Failed: 4)
  Failed tests:  24-27
  Non-zero exit status: 1
t3404-rebase-interactive.sh                      (Wstat: 256 Tests: 91 Failed: 57)
  Failed tests:  17, 19, 21-42, 44, 46-74, 77, 81-82
  Non-zero exit status: 1
t3900-i18n-commit.sh                             (Wstat: 256 Tests: 34 Failed: 1)
  Failed test:  34
  Non-zero exit status: 1
t5407-post-rewrite-hook.sh                       (Wstat: 256 Tests: 14 Failed: 6)
  Failed tests:  9-14
  Non-zero exit status: 1
t7001-mv.sh                                      (Wstat: 256 Tests: 46 Failed: 5)
  Failed tests:  39-43
  Non-zero exit status: 1
t7509-commit.sh                                  (Wstat: 256 Tests: 12 Failed: 2)
  Failed tests:  11-12
  Non-zero exit status: 1
t7512-status-help.sh                             (Wstat: 256 Tests: 39 Failed: 35)
  Failed tests:  5-39
  Non-zero exit status: 1
t6030-bisect-porcelain.sh                        (Wstat: 256 Tests: 70 Failed: 1)
  Failed test:  13
  Non-zero exit status: 1

And if a branch is named "H", "HE", or "HEA" then the current if clause
erroneously considers it as matching "HEAD" because it only compares
up to the end of the branch name.

Fix that by doing the comparison using strcmp() and only after the
branch name is extracted.  This way neither too less nor too many
characters are checked.  While at it call strchrnul() to find the end
of the branch name instead of open-coding it.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoident.c: add support for IPv6
Elia Pinto [Fri, 27 Nov 2015 14:08:27 +0000 (14:08 +0000)]
ident.c: add support for IPv6

Add IPv6 support by implementing name resolution with the
protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
code is still available when git is compiled with NO_IPV6.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
8 years agohttp: treat config options sslCAPath and sslCAInfo as paths
Charles Bailey [Mon, 23 Nov 2015 12:02:40 +0000 (12:02 +0000)]
http: treat config options sslCAPath and sslCAInfo as paths

This enables ~ and ~user expansion for these config options.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoDocumentation/diff: give --word-diff-regex=. example
Michael J Gruber [Fri, 20 Nov 2015 13:36:14 +0000 (14:36 +0100)]
Documentation/diff: give --word-diff-regex=. example

It's just so useful.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Jeff King <peff@peff.net>
8 years agofilter-branch: deal with object name vs. pathname ambiguity in tree-filter
SZEDER Gábor [Mon, 23 Nov 2015 12:23:16 +0000 (13:23 +0100)]
filter-branch: deal with object name vs. pathname ambiguity in tree-filter

'git filter-branch' fails complaining about an ambiguous argument, if
a tree-filter renames a path and the new pathname happens to match an
existing object name.

After the tree-filter has been applied, 'git filter-branch' looks for
changed paths by running:

  git diff-index -r --name-only --ignore-submodules $commit

which then, because of the lack of disambiguating double-dash, can't
decide whether to treat '$commit' as revision or path and errors out.

Add that disambiguating double-dash after 'git diff-index's revision
argument to make sure that '$commit' is interpreted as a revision.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agocheck-ignore: correct documentation about output
Dennis Kaarsemaker [Fri, 20 Nov 2015 20:30:48 +0000 (21:30 +0100)]
check-ignore: correct documentation about output

By default git check-ignore shows only the filenames that will be
ignored, not the pattern that causes their exclusion. Instead of moving
the partial exclude pattern precendence information to the -v option
where it belongs, link to gitignore(5) which describes this more
thoroughly.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoDocumentation/git-update-index: add missing opts to synopsys
Christian Couder [Tue, 24 Nov 2015 11:55:07 +0000 (12:55 +0100)]
Documentation/git-update-index: add missing opts to synopsys

Untracked cache related options should appear in the synopsis.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Jeff King <peff@peff.net>
8 years agogit-p4: clean up after p4 submit failure
GIRARD Etienne [Tue, 24 Nov 2015 07:43:59 +0000 (07:43 +0000)]
git-p4: clean up after p4 submit failure

When "p4 submit" command fails in P4Submit.applyCommit, the
workspace is left with the changes.  We already have code to revert
the changes to the workspace when the user decides to cancel
submission by aborting the editor that edits the change description,
and we should treat the "p4 submit" failure the same way.

Clean the workspace if p4_write_pipe raised SystemExit, so that the
user don't have to do it themselves.

Signed-off-by: GIRARD Etienne <egirard@murex.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
8 years agobash prompt: indicate dirty index even on orphan branches
SZEDER Gábor [Sat, 21 Nov 2015 11:30:09 +0000 (12:30 +0100)]
bash prompt: indicate dirty index even on orphan branches

__git_ps1() doesn't indicate dirty index while on an orphan branch.

To check the dirtiness of the index, __git_ps1() runs 'git diff-index
--cached ... HEAD', which doesn't work on an orphan branch,
because HEAD doesn't point to a valid commit.

Run 'git diff ... --cached' instead, as it does the right thing both
on valid and invalid HEAD, i.e. compares the index to the existing
HEAD in the former case and to the empty tree in the latter.  This
fixes the two failing tests added in the first commit of this series.

The dirtiness of the worktree is already checked with 'git diff' and
is displayed correctly even on an orphan branch.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agobash prompt: remove a redundant 'git diff' option
SZEDER Gábor [Sat, 21 Nov 2015 14:46:40 +0000 (15:46 +0100)]
bash prompt: remove a redundant 'git diff' option

To get the dirty state indicator __git_ps1() runs 'git diff' with
'--quiet --exit-code' options.  '--quiet' already implies
'--exit-code', so the latter is unnecessary and can be removed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agobash prompt: test dirty index and worktree while on an orphan branch
SZEDER Gábor [Sat, 21 Nov 2015 11:30:07 +0000 (12:30 +0100)]
bash prompt: test dirty index and worktree while on an orphan branch

There is only a single test exercising the dirty state indicator on an
orphan branch, and in that test neither the index nor the worktree are
dirty.

Add two failing tests to check the dirty state indicator while either
the index is dirty or while both the index and the worktree are dirty
on an orphan branch, and to show that the dirtiness of the index is
not displayed in these cases (the fourth combination, i.e. clean index
and dirty worktree are impossible on an orphan branch).  Update the
existing dirty state indicator on clean orphan branch test to match
the style of the two new tests, most importantly to use 'git checkout
--orphan' instead of cd-ing into a repository that just happens to be
empty and clean.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
8 years agogit-p4: work with a detached head
Luke Diamand [Sat, 21 Nov 2015 09:54:41 +0000 (09:54 +0000)]
git-p4: work with a detached head

When submitting, git-p4 finds the current branch in
order to know if it is allowed to submit (configuration
"git-p4.allowSubmit").

On a detached head, detecting the branch would fail, and
git-p4 would report a cryptic error.

This change teaches git-p4 to recognise a detached head and
submit successfully.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
8 years agogit-p4: add option to system() to return subshell status
Luke Diamand [Sat, 21 Nov 2015 09:54:40 +0000 (09:54 +0000)]
git-p4: add option to system() to return subshell status

Add an optional parameter ignore_error to the git-p4 system()
function. If used, it will return the subshell exit status
rather than throwing an exception.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
8 years agogit-p4: add failing test for submit from detached head
Luke Diamand [Sat, 21 Nov 2015 09:54:39 +0000 (09:54 +0000)]
git-p4: add failing test for submit from detached head

git-p4 can't submit from a detached head. This test case
demonstrates the problem.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoremote-http(s): support SOCKS proxies
Pat Thoyts [Mon, 26 Oct 2015 13:15:07 +0000 (14:15 +0100)]
remote-http(s): support SOCKS proxies

With this patch we properly support SOCKS proxies, configured e.g. like
this:

git config http.proxy socks5://192.168.67.1:32767

Without this patch, Git mistakenly tries to use SOCKS proxies as if they
were HTTP proxies, resulting in a error message like:

fatal: unable to access 'http://.../': Proxy CONNECT aborted

This patch was required to work behind a faulty AP and scraped from
http://stackoverflow.com/questions/15227130/#15228479 and guarded with
an appropriate cURL version check by Johannes Schindelin.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot5813: avoid creating urls that break on cygwin
Dennis Kaarsemaker [Mon, 9 Nov 2015 17:49:35 +0000 (18:49 +0100)]
t5813: avoid creating urls that break on cygwin

When passed an ssh:// url, git strips ssh://host from the url but does
not remove leading slashes from the path. So when this test used
ssh://remote//path/to/pwd, the path accessed by our fake SSH is
//path/to/pwd, which cygwin interprets as a UNC path, causing the test
to fail.

We may want to actually fix this in git itself, making it remove extra
slashes from urls before feeding them to transports or helpers, but
that's for another topic as it could cause regressions.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoEscape Git's exec path in contrib/rerere-train.sh script
Daniel Knittl-Frank [Sun, 8 Nov 2015 11:27:55 +0000 (12:27 +0100)]
Escape Git's exec path in contrib/rerere-train.sh script

Whitespace can cause the source command to fail. This is usually not a
problem on Unix systems, but on Windows Git is likely to be installed
under "C:/Program Files/", thus rendering the script broken.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Signed-off-by: Jeff King <peff@peff.net>
8 years agoallow hooks to ignore their standard input stream
Clemens Buchacher [Mon, 16 Nov 2015 08:05:58 +0000 (09:05 +0100)]
allow hooks to ignore their standard input stream

Since ec7dbd145 (receive-pack: allow hooks to ignore its
standard input stream) the pre-receive and post-receive
hooks ignore SIGPIPE. Do the same for the remaining hooks
pre-push and post-rewrite, which read from standard input.
The same arguments for ignoring SIGPIPE apply.

Include test by Jeff King which checks that SIGPIPE does not
cause pre-push hook failure. With the use of git update-ref
--stdin it is fast enough to be enabled by default.

Signed-off-by: Clemens Buchacher <clemens.buchacher@intel.com>
Signed-off-by: Jeff King <peff@peff.net>