gitweb.git
sequencer (rebase -i): implement the 'reword' commandJohannes Schindelin Mon, 2 Jan 2017 15:28:00 +0000 (16:28 +0100)

sequencer (rebase -i): implement the 'reword' command

This is now trivial, as all the building blocks are in place: all we need
to do is to flip the "edit" switch when committing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): leave a patch upon errorJohannes Schindelin Mon, 2 Jan 2017 15:27:57 +0000 (16:27 +0100)

sequencer (rebase -i): leave a patch upon error

When doing an interactive rebase, we want to leave a 'patch' file for
further inspection by the user (even if we never tried to actually apply
that patch, since we're cherry-picking instead).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): update refs after a successful... Johannes Schindelin Mon, 2 Jan 2017 15:27:53 +0000 (16:27 +0100)

sequencer (rebase -i): update refs after a successful rebase

An interactive rebase operates on a detached HEAD (to keep the reflog
of the original branch relatively clean), and updates the branch only
at the end.

Now that the sequencer learns to perform interactive rebases, it also
needs to learn the trick to update the branch before removing the
directory containing the state of the interactive rebase.

We introduce a new head_ref variable in a wider scope than necessary at
the moment, to allow for a later patch that prints out "Successfully
rebased and updated <ref>".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): the todo can be empty when conti... Johannes Schindelin Mon, 2 Jan 2017 15:27:34 +0000 (16:27 +0100)

sequencer (rebase -i): the todo can be empty when continuing

When the last command of an interactive rebase fails, the user needs to
resolve the problem and then continue the interactive rebase. Naturally,
the todo script is empty by then. So let's not complain about that!

To that end, let's move that test out of the function that parses the
todo script, and into the more high-level function read_populate_todo().
This is also necessary by now because the lower-level parse_insn_buffer()
has no idea whether we are performing an interactive rebase or not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): skip some revert/cherry-pick... Johannes Schindelin Mon, 2 Jan 2017 15:27:30 +0000 (16:27 +0100)

sequencer (rebase -i): skip some revert/cherry-pick specific code path

When a cherry-pick continues without a "todo script", the intention is
simply to pick a single commit.

However, when an interactive rebase is continued without a "todo
script", it means that the last command has been completed and that we
now need to clean up.

This commit guards the revert/cherry-pick specific steps so that they
are not executed in rebase -i mode.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): remove CHERRY_PICK_HEAD when... Johannes Schindelin Mon, 2 Jan 2017 15:27:25 +0000 (16:27 +0100)

sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed

The scripted version of the interactive rebase already does that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): allow continuing with staged... Johannes Schindelin Mon, 2 Jan 2017 15:27:21 +0000 (16:27 +0100)

sequencer (rebase -i): allow continuing with staged changes

When an interactive rebase is interrupted, the user may stage changes
before continuing, and we need to commit those changes in that case.

Please note that the nested "if" added to the sequencer_continue() is
not combined into a single "if" because it will be extended with an
"else" clause in a later patch in this patch series.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): write an author-script fileJohannes Schindelin Mon, 2 Jan 2017 15:27:18 +0000 (16:27 +0100)

sequencer (rebase -i): write an author-script file

When the interactive rebase aborts, it writes out an author-script file
to record the author information for the current commit. As we are about
to teach the sequencer how to perform the actions behind an interactive
rebase, it needs to write those author-script files, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): implement the short commandsJohannes Schindelin Mon, 2 Jan 2017 15:27:15 +0000 (16:27 +0100)

sequencer (rebase -i): implement the short commands

For users' convenience, most rebase commands can be abbreviated, e.g.
'p' instead of 'pick' and 'x' instead of 'exec'. Let's teach the
sequencer to handle those abbreviated commands just fine.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): add support for the 'fixup'... Johannes Schindelin Mon, 2 Jan 2017 15:27:07 +0000 (16:27 +0100)

sequencer (rebase -i): add support for the 'fixup' and 'squash' commands

This is a huge patch, and at the same time a huge step forward to
execute the performance-critical parts of the interactive rebase in a
builtin command.

Since 'fixup' and 'squash' are not only similar, but also need to know
about each other (we want to reduce a series of fixups/squashes into a
single, final commit message edit, from the user's point of view), we
really have to implement them both at the same time.

Most of the actual work is done by the existing code path that already
handles the "pick" and the "edit" commands; We added support for other
features (e.g. to amend the commit message) in the patches leading up to
this one, yet there are still quite a few bits in this patch that simply
would not make sense as individual patches (such as: determining whether
there was anything to "fix up" in the "todo" script, etc).

In theory, it would be possible to reuse the fast-forward code path also
for the fixup and the squash code paths, but in practice this would make
the code less readable. The end result cannot be fast-forwarded anyway,
therefore let's just extend the cherry-picking code path for now.

Since the sequencer parses the entire `git-rebase-todo` script in one go,
fixup or squash commands without a preceding pick can be reported early
(in git-rebase--interactive, we could only report such errors just before
executing the fixup/squash).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): write the 'done' fileJohannes Schindelin Mon, 2 Jan 2017 15:27:00 +0000 (16:27 +0100)

sequencer (rebase -i): write the 'done' file

In the interactive rebase, commands that were successfully processed are
not simply discarded, but appended to the 'done' file instead. This is
used e.g. to display the current state to the user in the output of
`git status` or the progress.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): learn about the 'verbose' modeJohannes Schindelin Mon, 2 Jan 2017 15:26:53 +0000 (16:26 +0100)

sequencer (rebase -i): learn about the 'verbose' mode

When calling `git rebase -i -v`, the user wants to see some statistics
after the commits were rebased. Let's show some.

The strbuf we use to perform that task will be used for other things
in subsequent commits, hence it is declared and initialized in a wider
scope than strictly needed here.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): implement the 'exec' commandJohannes Schindelin Mon, 2 Jan 2017 15:26:47 +0000 (16:26 +0100)

sequencer (rebase -i): implement the 'exec' command

The 'exec' command is a little special among rebase -i's commands, as it
does *not* have a SHA-1 as first parameter. Instead, everything after the
`exec` command is treated as command-line to execute.

Let's reuse the arg/arg_len fields of the todo_item structure (which hold
the oneline for pick/edit commands) to point to the command-line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): implement the 'edit' commandJohannes Schindelin Mon, 2 Jan 2017 15:26:43 +0000 (16:26 +0100)

sequencer (rebase -i): implement the 'edit' command

This patch is a straight-forward reimplementation of the `edit`
operation of the interactive rebase command.

Well, not *quite* straight-forward: when stopping, the `edit`
command wants to write the `patch` file (which is not only the
patch, but includes the commit message and author information). To
that end, this patch requires the earlier work that taught the
log-tree machinery to respect the `file` setting of
rev_info->diffopt to write to a file stream different than stdout.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer (rebase -i): implement the 'noop' commandJohannes Schindelin Mon, 2 Jan 2017 15:26:38 +0000 (16:26 +0100)

sequencer (rebase -i): implement the 'noop' command

The 'noop' command is probably the most boring of all rebase -i commands
to support in the sequencer.

Which makes it an excellent candidate for this first stab to add support
for rebase -i's commands to the sequencer.

For the moment, let's also treat empty lines and commented-out lines as
'noop'; We will refine that handling later in this patch series.

To make it easier to identify "classes" of todo_commands (such as:
determine whether a command is pick-like, i.e. handles a single commit),
let's enforce a certain order of said commands.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: support a new action: 'interactive rebase'Johannes Schindelin Mon, 2 Jan 2017 15:26:28 +0000 (16:26 +0100)

sequencer: support a new action: 'interactive rebase'

This patch introduces a new action for the sequencer. It really does not
do a whole lot of its own right now, but lays the ground work for
patches to come. The intention, of course, is to finally make the
sequencer the work horse of the interactive rebase (the original idea
behind the "sequencer" concept).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: use a helper to find the commit messageJohannes Schindelin Mon, 2 Jan 2017 15:26:20 +0000 (16:26 +0100)

sequencer: use a helper to find the commit message

It is actually not safe to look for a commit message by looking for the
first empty line and skipping it.

The find_commit_subject() function looks more carefully, so let's use
it. Since we are interested in the entire commit message, we re-compute
the string length after verifying that the commit subject is not empty
(in which case the entire commit message would be empty, something that
should not happen but that we want to handle gracefully).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: move "else" keyword onto the same line as... Johannes Schindelin Mon, 2 Jan 2017 15:26:14 +0000 (16:26 +0100)

sequencer: move "else" keyword onto the same line as preceding brace

It is the current coding style of the Git project to write

if (...) {
...
} else {
...
}

instead of putting the closing brace and the "else" keyword on separate
lines.

Pointed out by Junio Hamano.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: avoid unnecessary curly bracesJohannes Schindelin Mon, 2 Jan 2017 15:26:08 +0000 (16:26 +0100)

sequencer: avoid unnecessary curly braces

This was noticed while addressing Junio Hamano's concern that some
"else" operators were on separate lines than the preceding closing
brace.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fourth batch for 2.12Junio C Hamano Tue, 27 Dec 2016 17:17:51 +0000 (09:17 -0800)

Fourth batch for 2.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/lock-report-on-error'Junio C Hamano Tue, 27 Dec 2016 17:17:32 +0000 (09:17 -0800)

Merge branch 'jc/lock-report-on-error'

* jc/lock-report-on-error:
lockfile: move REPORT_ON_ERROR bit elsewhere

lockfile: move REPORT_ON_ERROR bit elsewhereJunio C Hamano Tue, 27 Dec 2016 17:12:09 +0000 (09:12 -0800)

lockfile: move REPORT_ON_ERROR bit elsewhere

There was LOCK_NO_DEREF defined as 2 = 1<<1 with the same value,
which was missed due to a huge comment block. Deconflict by moving
the new one to 4 = 1<<2 for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/mingw-isatty'Junio C Hamano Tue, 27 Dec 2016 08:11:46 +0000 (00:11 -0800)

Merge branch 'js/mingw-isatty'

Update the isatty() emulation for Windows by updating the previous
hack that depended on internals of (older) MSVC runtime.

* js/mingw-isatty:
mingw: replace isatty() hack
mingw: fix colourization on Cygwin pseudo terminals
mingw: adjust is_console() to work with stdin

Merge branch 'ls/p4-lfs'Junio C Hamano Tue, 27 Dec 2016 08:11:46 +0000 (00:11 -0800)

Merge branch 'ls/p4-lfs'

Update GitLFS integration with "git p4".

* ls/p4-lfs:
git-p4: add diff/merge properties to .gitattributes for GitLFS files

Merge branch 'va/i18n-even-more'Junio C Hamano Tue, 27 Dec 2016 08:11:45 +0000 (00:11 -0800)

Merge branch 'va/i18n-even-more'

* va/i18n-even-more:
i18n: fix misconversion in shell scripts

Merge branch 'lt/shortlog-by-committer'Junio C Hamano Tue, 27 Dec 2016 08:11:44 +0000 (00:11 -0800)

Merge branch 'lt/shortlog-by-committer'

"git shortlog" learned "--committer" option to group commits by
committer, instead of author.

* lt/shortlog-by-committer:
t4201: make tests work with and without the MINGW prerequiste
shortlog: test and document --committer option
shortlog: group by committer information

Merge branch 'mk/mingw-winansi-ttyname-termination... Junio C Hamano Tue, 27 Dec 2016 08:11:44 +0000 (00:11 -0800)

Merge branch 'mk/mingw-winansi-ttyname-termination-fix'

A potential but unlikely buffer overflow in Windows port has been
fixed.

* mk/mingw-winansi-ttyname-termination-fix:
mingw: consider that UNICODE_STRING::Length counts bytes

Merge branch 'gv/p4-multi-path-commit-fix'Junio C Hamano Tue, 27 Dec 2016 08:11:43 +0000 (00:11 -0800)

Merge branch 'gv/p4-multi-path-commit-fix'

"git p4" that tracks multile p4 paths imported a single changelist
that touches files in these multiple paths as one commit, followed
by many empty commits. This has been fixed.

* gv/p4-multi-path-commit-fix:
git-p4: fix multi-path changelist empty commits

Merge branch 'jk/difftool-in-subdir'Junio C Hamano Tue, 27 Dec 2016 08:11:43 +0000 (00:11 -0800)

Merge branch 'jk/difftool-in-subdir'

Even though an fix was attempted in Git 2.9.3 days, but running
"git difftool --dir-diff" from a subdirectory never worked. This
has been fixed.

* jk/difftool-in-subdir:
difftool: rename variables for consistency
difftool: chdir as early as possible
difftool: sanitize $workdir as early as possible
difftool: fix dir-diff index creation when in a subdirectory

Merge branch 'ld/p4-compare-dir-vs-symlink'Junio C Hamano Tue, 27 Dec 2016 08:11:42 +0000 (00:11 -0800)

Merge branch 'ld/p4-compare-dir-vs-symlink'

"git p4" misbehaved when swapping a directory and a symbolic link.

* ld/p4-compare-dir-vs-symlink:
git-p4: avoid crash adding symlinked directory

Merge branch 'ls/filter-process'Junio C Hamano Tue, 27 Dec 2016 08:11:42 +0000 (00:11 -0800)

Merge branch 'ls/filter-process'

Doc update.

* ls/filter-process:
t0021: fix flaky test
docs: warn about possible '=' in clean/smudge filter process values

Merge branch 'bw/transport-protocol-policy'Junio C Hamano Tue, 27 Dec 2016 08:11:41 +0000 (00:11 -0800)

Merge branch 'bw/transport-protocol-policy'

Finer-grained control of what protocols are allowed for transports
during clone/fetch/push have been enabled via a new configuration
mechanism.

* bw/transport-protocol-policy:
http: respect protocol.*.allow=user for http-alternates
transport: add from_user parameter to is_transport_allowed
http: create function to get curl allowed protocols
transport: add protocol policy config option
http: always warn if libcurl version is too old
lib-proto-disable: variable name fix

Merge branch 'cp/merge-continue'Junio C Hamano Tue, 27 Dec 2016 08:11:41 +0000 (00:11 -0800)

Merge branch 'cp/merge-continue'

"git merge --continue" has been added as a synonym to "git commit"
to conclude a merge that has stopped due to conflicts.

* cp/merge-continue:
merge: mark usage error strings for translation
merge: ensure '--abort' option takes no arguments
completion: add --continue option for merge
merge: add '--continue' option as a synonym for 'git commit'

Merge branch 'va/i18n-perl-scripts'Junio C Hamano Tue, 27 Dec 2016 08:11:40 +0000 (00:11 -0800)

Merge branch 'va/i18n-perl-scripts'

Porcelain scripts written in Perl are getting internationalized.

* va/i18n-perl-scripts:
i18n: difftool: mark warnings for translation
i18n: send-email: mark composing message for translation
i18n: send-email: mark string with interpolation for translation
i18n: send-email: mark warnings and errors for translation
i18n: send-email: mark strings for translation
i18n: add--interactive: mark status words for translation
i18n: add--interactive: remove %patch_modes entries
i18n: add--interactive: mark edit_hunk_manually message for translation
i18n: add--interactive: i18n of help_patch_cmd
i18n: add--interactive: mark patch prompt for translation
i18n: add--interactive: mark plural strings
i18n: clean.c: match string with git-add--interactive.perl
i18n: add--interactive: mark strings with interpolation for translation
i18n: add--interactive: mark simple here-documents for translation
i18n: add--interactive: mark strings for translation
Git.pm: add subroutines for commenting lines

Merge branch 'sb/submodule-config-cleanup'Junio C Hamano Tue, 27 Dec 2016 08:11:40 +0000 (00:11 -0800)

Merge branch 'sb/submodule-config-cleanup'

Minor code clean-up.

* sb/submodule-config-cleanup:
submodule-config: clarify parsing of null_sha1 element
submodule-config: rename commit_sha1 to treeish_name
submodule config: inline config_from_{name, path}

Merge branch 'jc/push-default-explicit'Junio C Hamano Tue, 27 Dec 2016 08:11:40 +0000 (00:11 -0800)

Merge branch 'jc/push-default-explicit'

A lazy "git push" without refspec did not internally use a fully
specified refspec to perform 'current', 'simple', or 'upstream'
push, causing unnecessary "ambiguous ref" errors.

* jc/push-default-explicit:
push: test pushing ambiguously named branches
push: do not use potentially ambiguous default refspec

mingw: replace isatty() hackJeff Hostetler Thu, 22 Dec 2016 17:09:23 +0000 (18:09 +0100)

mingw: replace isatty() hack

Git for Windows has carried a patch that depended on internals
of MSVC runtime, but it does not work correctly with recent MSVC
runtime. A replacement was written originally for compiling
with VC++. The patch in this message is a backport of that
replacement, and it also fixes the previous attempt to make
isatty() tell that /dev/null is *not* an interactive terminal.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Tested-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: fix colourization on Cygwin pseudo terminalsAlan Davies Thu, 22 Dec 2016 17:09:18 +0000 (18:09 +0100)

mingw: fix colourization on Cygwin pseudo terminals

Git only colours the output and uses pagination if isatty() returns 1.
MSYS2 and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

f7f90e0f4f (mingw: make isatty() recognize MSYS2's pseudo terminals
(/dev/pty*), 2016-04-27) fixed this for MSYS2 terminals, but not for
Cygwin.

The named pipes that Cygwin and MSYS2 use are very similar. MSYS2 PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'. This commit
modifies the existing check to allow both MSYS2 and Cygwin PTY pipes to be
identified as TTYs.

Note that pagination is still broken when running Git for Windows from
within Cygwin, as MSYS2's less.exe is spawned (and does not like to
interact with Cygwin's PTY).

This partially fixes https://github.com/git-for-windows/git/issues/267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: adjust is_console() to work with stdinJohannes Schindelin Thu, 22 Dec 2016 17:08:57 +0000 (18:08 +0100)

mingw: adjust is_console() to work with stdin

When determining whether a handle corresponds to a *real* Win32 Console
(as opposed to, say, a character device such as /dev/null), we use the
GetConsoleOutputBufferInfo() function as a tell-tale.

However, that does not work for *input* handles associated with a
console. Let's just use the GetConsoleMode() function for input handles,
and since it does not work on output handles fall back to the previous
method for those.

This patch prepares for using is_console() instead of my previous
misguided attempt in cbb3f3c9b1 (mingw: intercept isatty() to handle
/dev/null as Git expects it, 2016-12-11) that broke everything on
Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Third batch for 2.12Junio C Hamano Wed, 21 Dec 2016 22:57:26 +0000 (14:57 -0800)

Third batch for 2.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jt/mailinfo-fold-in-body-headers'Junio C Hamano Wed, 21 Dec 2016 22:55:03 +0000 (14:55 -0800)

Merge branch 'jt/mailinfo-fold-in-body-headers'

Fix for NDEBUG builds.

* jt/mailinfo-fold-in-body-headers:
mailinfo.c: move side-effects outside of assert

Merge branch 'jk/index-pack-wo-repo-from-stdin'Junio C Hamano Wed, 21 Dec 2016 22:55:03 +0000 (14:55 -0800)

Merge branch 'jk/index-pack-wo-repo-from-stdin'

"git index-pack --stdin" needs an access to an existing repository,
but "git index-pack file.pack" to generate an .idx file that
corresponds to a packfile does not.

* jk/index-pack-wo-repo-from-stdin:
index-pack: skip collision check when not in repository
t: use nongit() function where applicable
index-pack: complain when --stdin is used outside of a repo
t5000: extract nongit function to test-lib-functions.sh

Merge branch 'jk/parseopt-usage-msg-opt'Junio C Hamano Wed, 21 Dec 2016 22:55:03 +0000 (14:55 -0800)

Merge branch 'jk/parseopt-usage-msg-opt'

The function usage_msg_opt() has been updated to say "fatal:"
before the custom message programs give, when they want to die
with a message about wrong command line options followed by the
standard usage string.

* jk/parseopt-usage-msg-opt:
parse-options: print "fatal:" before usage_msg_opt()

Merge branch 'jk/quote-env-path-list-component'Junio C Hamano Wed, 21 Dec 2016 22:55:02 +0000 (14:55 -0800)

Merge branch 'jk/quote-env-path-list-component'

A recent update to receive-pack to make it easier to drop garbage
objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot
have a pathname with a colon in it (no surprise!), and this in turn
made it impossible to push into a repository at such a path. This
has been fixed by introducing a quoting mechanism used when
appending such a path to the colon-separated list.

* jk/quote-env-path-list-component:
t5615-alternate-env: double-quotes in file names do not work on Windows
t5547-push-quarantine: run the path separator test on Windows, too
tmp-objdir: quote paths we add to alternates
alternates: accept double-quoted paths

Merge branch 'vs/submodule-clone-nested-submodules... Junio C Hamano Wed, 21 Dec 2016 22:55:02 +0000 (14:55 -0800)

Merge branch 'vs/submodule-clone-nested-submodules-alternates'

"git clone --reference $there --recurse-submodules $super" has been
taught to guess repositories usable as references for submodules of
$super that are embedded in $there while making a clone of the
superproject borrow objects from $there; extend the mechanism to
also allow submodules of these submodules to borrow repositories
embedded in these clones of the submodules embedded in the clone of
the superproject.

* vs/submodule-clone-nested-submodules-alternates:
submodule--helper: set alternateLocation for cloned submodules

Merge branch 'nd/shallow-fixup'Junio C Hamano Wed, 21 Dec 2016 22:55:01 +0000 (14:55 -0800)

Merge branch 'nd/shallow-fixup'

Code cleanup in shallow boundary computation.

* nd/shallow-fixup:
shallow.c: remove useless code
shallow.c: bit manipulation tweaks
shallow.c: avoid theoretical pointer wrap-around
shallow.c: make paint_alloc slightly more robust
shallow.c: stop abusing COMMIT_SLAB_SIZE for paint_info's memory pools
shallow.c: rename fields in paint_info to better express their purposes

Merge branch 'sb/sequencer-abort-safety'Junio C Hamano Wed, 21 Dec 2016 22:55:01 +0000 (14:55 -0800)

Merge branch 'sb/sequencer-abort-safety'

Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back
to where cherry-pick started while picking multiple changes, when
the cherry-pick stopped to ask for help from the user, and the user
did "git reset --hard" to a different commit in order to re-attempt
the operation.

* sb/sequencer-abort-safety:
Revert "sequencer: remove useless get_dir() function"
sequencer: remove useless get_dir() function
sequencer: make sequencer abort safer
t3510: test that cherry-pick --abort does not unsafely change HEAD
am: change safe_to_abort()'s not rewinding error into a warning
am: fix filename in safe_to_abort() error message

t5615-alternate-env: double-quotes in file names do... Johannes Sixt Wed, 21 Dec 2016 21:33:43 +0000 (22:33 +0100)

t5615-alternate-env: double-quotes in file names do not work on Windows

Protect a recently added test case with !MINGW.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4201: make tests work with and without the MINGW prere... Junio C Hamano Tue, 20 Dec 2016 18:35:54 +0000 (10:35 -0800)

t4201: make tests work with and without the MINGW prerequiste

Make sure the tests do not depend on the result of the previous
tests. With MINGW prerequisite satisfied, a "reset to original and
rebuild" in an earlier test was skipped, resulting in different
history being tested with this and the next tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: add diff/merge properties to .gitattributes... Lars Schneider Sun, 18 Dec 2016 19:01:40 +0000 (20:01 +0100)

git-p4: add diff/merge properties to .gitattributes for GitLFS files

The `git lfs track` command generates a .gitattributes file with diff
and merge properties [1]. Set the same .gitattributes format for files
tracked with GitLFS in git-p4.

[1] https://github.com/git-lfs/git-lfs/blob/v1.5.3/commands/command_track.go#L121

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: fix misconversion in shell scriptsJunio C Hamano Tue, 20 Dec 2016 17:36:23 +0000 (09:36 -0800)

i18n: fix misconversion in shell scripts

An earlier series that was merged at 2703572b3a ("Merge branch
'va/i18n-even-more'", 2016-07-13) failed to use $(eval_gettext
"string with \$variable interpolation") and instead used gettext in
a few places, and ended up showing the variable names in the
message, e.g.

$ git submodule
fatal: $program_name cannot be used without a working tree.

Catch these mistakes with

$ git grep -n '[^_]gettext .*\\\$'

and fix them all to use eval_gettext instead.

Reported-by: Josh Bleecher Snyder
Acked-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo.c: move side-effects outside of assertKyle J. McKay Mon, 19 Dec 2016 23:13:00 +0000 (15:13 -0800)

mailinfo.c: move side-effects outside of assert

Since 6b4b013f18 (mailinfo: handle in-body header continuations,
2016-09-20, v2.11.0) mailinfo.c has contained new code with an
assert of the form:

assert(call_a_function(...))

The function in question, check_header, has side effects. This
means that when NDEBUG is defined during a release build the
function call is omitted entirely, the side effects do not
take place and tests (fortunately) start failing.

Since the only time that mi->inbody_header_accum is appended to is
in check_inbody_header, and appending onto a blank
mi->inbody_header_accum always happens when is_inbody_header is
true, this guarantees a prefix that causes check_header to always
return true.

Therefore replace the assert with an if !check_header + DIE
combination to reflect this.

Helped-by: Jonathan Tan <jonathantanmy@google.com>
Helped-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: consider that UNICODE_STRING::Length counts... Max Kirillov Mon, 19 Dec 2016 21:32:00 +0000 (23:32 +0200)

mingw: consider that UNICODE_STRING::Length counts bytes

UNICODE_STRING::Length field means size of buffer in bytes[1],
despite of buffer itself being array of wchar_t. Because of that
terminating zero is placed twice as far. Fix it.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa380518.aspx

Signed-off-by: Max Kirillov <max@max630.net>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Second batch for 2.12Junio C Hamano Mon, 19 Dec 2016 22:50:31 +0000 (14:50 -0800)

Second batch for 2.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'kh/tutorial-grammofix'Junio C Hamano Mon, 19 Dec 2016 22:45:41 +0000 (14:45 -0800)

Merge branch 'kh/tutorial-grammofix'

* kh/tutorial-grammofix:
doc: omit needless "for"
doc: make the intent of sentence clearer
doc: add verb in front of command to run
doc: add articles (grammar)

Merge branch 'da/mergetool-xxdiff-hotkey'Junio C Hamano Mon, 19 Dec 2016 22:45:41 +0000 (14:45 -0800)

Merge branch 'da/mergetool-xxdiff-hotkey'

The way to specify hotkeys to "xxdiff" that is used by "git
mergetool" has been modernized to match recent versions of xxdiff.

* da/mergetool-xxdiff-hotkey:
mergetools: fix xxdiff hotkeys

Merge branch 'lr/doc-fix-cet'Junio C Hamano Mon, 19 Dec 2016 22:45:41 +0000 (14:45 -0800)

Merge branch 'lr/doc-fix-cet'

* lr/doc-fix-cet:
date-formats.txt: Typo fix

Merge branch 'sb/t3600-cleanup'Junio C Hamano Mon, 19 Dec 2016 22:45:39 +0000 (14:45 -0800)

Merge branch 'sb/t3600-cleanup'

Code cleanup.

* sb/t3600-cleanup:
t3600: slightly modernize style
t3600: remove useless redirect

Merge branch 'jc/pull-rebase-ff'Junio C Hamano Mon, 19 Dec 2016 22:45:38 +0000 (14:45 -0800)

Merge branch 'jc/pull-rebase-ff'

"git pull --rebase", when there is no new commits on our side since
we forked from the upstream, should be able to fast-forward without
invoking "git rebase", but it didn't.

* jc/pull-rebase-ff:
pull: fast-forward "pull --rebase=true"

Merge branch 'ld/p4-worktree'Junio C Hamano Mon, 19 Dec 2016 22:45:37 +0000 (14:45 -0800)

Merge branch 'ld/p4-worktree'

"git p4" didn't interact with the internal of .git directory
correctly in the modern "git-worktree"-enabled world.

* ld/p4-worktree:
git-p4: support git worktrees

Merge branch 'jk/make-tags-find-sources-tweak'Junio C Hamano Mon, 19 Dec 2016 22:45:37 +0000 (14:45 -0800)

Merge branch 'jk/make-tags-find-sources-tweak'

Update the procedure to generate "tags" for developer support.

* jk/make-tags-find-sources-tweak:
Makefile: exclude contrib from FIND_SOURCE_FILES
Makefile: match shell scripts in FIND_SOURCE_FILES
Makefile: exclude test cruft from FIND_SOURCE_FILES
Makefile: reformat FIND_SOURCE_FILES

Merge branch 'js/normalize-path-copy-ceil'Junio C Hamano Mon, 19 Dec 2016 22:45:37 +0000 (14:45 -0800)

Merge branch 'js/normalize-path-copy-ceil'

A pathname that begins with "//" or "\\" on Windows is special but
path normalization logic was unaware of it.

* js/normalize-path-copy-ceil:
normalize_path_copy(): fix pushing to //server/share/dir on Windows

Merge branch 'bb/unicode-9.0'Junio C Hamano Mon, 19 Dec 2016 22:45:36 +0000 (14:45 -0800)

Merge branch 'bb/unicode-9.0'

The character width table has been updated to match Unicode 9.0

* bb/unicode-9.0:
unicode_width.h: update the width tables to Unicode 9.0
update_unicode.sh: remove the plane filter
update_unicode.sh: automatically download newer definition files
update_unicode.sh: pin the uniset repo to a known good commit
update_unicode.sh: remove an unnecessary subshell level
update_unicode.sh: move it into contrib/update-unicode

Merge branch 'jk/readme-gmane-is-no-more'Junio C Hamano Mon, 19 Dec 2016 22:45:35 +0000 (14:45 -0800)

Merge branch 'jk/readme-gmane-is-no-more'

* jk/readme-gmane-is-no-more:
README: replace gmane link with public-inbox

Merge branch 'jc/lock-report-on-error'Junio C Hamano Mon, 19 Dec 2016 22:45:35 +0000 (14:45 -0800)

Merge branch 'jc/lock-report-on-error'

Git 2.11 had a minor regression in "merge --ff-only" that competed
with another process that simultanously attempted to update the
index. We used to explain what went wrong with an error message,
but the new code silently failed. The error message has been
resurrected.

* jc/lock-report-on-error:
lockfile: LOCK_REPORT_ON_ERROR
hold_locked_index(): align error handling with hold_lockfile_for_update()
wt-status: implement opportunisitc index update correctly

Merge branch 'jk/xdiff-drop-xdl-fast-hash'Junio C Hamano Mon, 19 Dec 2016 22:45:35 +0000 (14:45 -0800)

Merge branch 'jk/xdiff-drop-xdl-fast-hash'

Retire the "fast hash" that had disastrous performance issues in
some corner cases.

* jk/xdiff-drop-xdl-fast-hash:
xdiff: drop XDL_FAST_HASH

Merge branch 'nd/rebase-forget'Junio C Hamano Mon, 19 Dec 2016 22:45:35 +0000 (14:45 -0800)

Merge branch 'nd/rebase-forget'

"git rebase" learned "--quit" option, which allows a user to
remove the metadata left by an earlier "git rebase" that was
manually aborted without using "git rebase --abort".

* nd/rebase-forget:
rebase: add --quit to cleanup rebase, leave everything else untouched

Merge branch 'jk/trailers-placeholder-in-pretty'Junio C Hamano Mon, 19 Dec 2016 22:45:34 +0000 (14:45 -0800)

Merge branch 'jk/trailers-placeholder-in-pretty'

In addition to %(subject), %(body), "log --pretty=format:..."
learned a new placeholder %(trailers).

* jk/trailers-placeholder-in-pretty:
ref-filter: add support to display trailers as part of contents
pretty: add %(trailers) format for displaying trailers of a commit message

Merge branch 'ak/commit-only-allow-empty'Junio C Hamano Mon, 19 Dec 2016 22:45:34 +0000 (14:45 -0800)

Merge branch 'ak/commit-only-allow-empty'

"git commit --allow-empty --only" (no pathspec) with dirty index
ought to be an acceptable way to create a new commit that does not
change any paths, but it was forbidden, perhaps because nobody
needed it so far.

* ak/commit-only-allow-empty:
commit: remove 'Clever' message for --only --amend
commit: make --only --allow-empty work without paths

Merge branch 'da/difftool-dir-diff-fix'Junio C Hamano Mon, 19 Dec 2016 22:45:33 +0000 (14:45 -0800)

Merge branch 'da/difftool-dir-diff-fix'

"git difftool --dir-diff" had a minor regression when started from
a subdirectory, which has been fixed.

* da/difftool-dir-diff-fix:
difftool: fix dir-diff index creation when in a subdirectory

Merge branch 'jb/diff-no-index-no-abbrev'Junio C Hamano Mon, 19 Dec 2016 22:45:33 +0000 (14:45 -0800)

Merge branch 'jb/diff-no-index-no-abbrev'

"git diff --no-index" did not take "--no-abbrev" option.

* jb/diff-no-index-no-abbrev:
diff: handle --no-abbrev in no-index case

Merge branch 'rj/git-version-gen-do-not-force-abbrev'Junio C Hamano Mon, 19 Dec 2016 22:45:33 +0000 (14:45 -0800)

Merge branch 'rj/git-version-gen-do-not-force-abbrev'

A minor build update.

* rj/git-version-gen-do-not-force-abbrev:
GIT-VERSION-GEN: do not force abbreviation length used by 'describe'

Merge branch 'jk/stash-disable-renames-internally'Junio C Hamano Mon, 19 Dec 2016 22:45:33 +0000 (14:45 -0800)

Merge branch 'jk/stash-disable-renames-internally'

When diff.renames configuration is on (and with Git 2.9 and later,
it is enabled by default, which made it worse), "git stash"
misbehaved if a file is removed and another file with a very
similar content is added.

* jk/stash-disable-renames-internally:
stash: prefer plumbing over git-diff

Merge branch 'jk/http-walker-limit-redirect'Junio C Hamano Mon, 19 Dec 2016 22:45:32 +0000 (14:45 -0800)

Merge branch 'jk/http-walker-limit-redirect'

Update the error messages from the dumb-http client when it fails
to obtain loose objects; we used to give sensible error message
only upon 404 but we now forbid unexpected redirects that needs to
be reported with something sensible.

* jk/http-walker-limit-redirect:
http-walker: complain about non-404 loose object errors

Merge branch 'jk/http-walker-limit-redirect-2.9'Junio C Hamano Mon, 19 Dec 2016 22:45:31 +0000 (14:45 -0800)

Merge branch 'jk/http-walker-limit-redirect-2.9'

Transport with dumb http can be fooled into following foreign URLs
that the end user does not intend to, especially with the server
side redirects and http-alternates mechanism, which can lead to
security issues. Tighten the redirection and make it more obvious
to the end user when it happens.

* jk/http-walker-limit-redirect-2.9:
http: treat http-alternates like redirects
http: make redirects more obvious
remote-curl: rename shadowed options variable
http: always update the base URL for redirects
http: simplify update_url_from_redirect

Merge branch 'nd/for-each-ref-ignore-case'Junio C Hamano Mon, 19 Dec 2016 22:45:31 +0000 (14:45 -0800)

Merge branch 'nd/for-each-ref-ignore-case'

"git branch --list" and friends learned "--ignore-case" option to
optionally sort branches and tags case insensitively.

* nd/for-each-ref-ignore-case:
tag, branch, for-each-ref: add --ignore-case for sorting and filtering

Merge branch 'sb/unpack-trees-grammofix'Junio C Hamano Mon, 19 Dec 2016 22:45:31 +0000 (14:45 -0800)

Merge branch 'sb/unpack-trees-grammofix'

* sb/unpack-trees-grammofix:
unpack-trees: fix grammar for untracked files in directories

Merge branch 'ls/travis-update-p4-and-lfs'Junio C Hamano Mon, 19 Dec 2016 22:45:30 +0000 (14:45 -0800)

Merge branch 'ls/travis-update-p4-and-lfs'

The default Travis-CI configuration specifies newer P4 and GitLFS.

* ls/travis-update-p4-and-lfs:
travis-ci: update P4 to 16.2 and GitLFS to 1.5.2 in Linux build

Merge branch 'ls/t0021-fixup'Junio C Hamano Mon, 19 Dec 2016 22:45:30 +0000 (14:45 -0800)

Merge branch 'ls/t0021-fixup'

* ls/t0021-fixup:
t0021: minor filter process test cleanup

Merge branch 'ah/grammos'Junio C Hamano Mon, 19 Dec 2016 22:45:30 +0000 (14:45 -0800)

Merge branch 'ah/grammos'

A few messages have been fixed for their grammatical errors.

* ah/grammos:
clone,fetch: explain the shallow-clone option a little more clearly
receive-pack: improve English grammar of denyCurrentBranch message
bisect: improve English grammar of not-ancestors message

Merge branch 'jc/renormalize-merge-kill-safer-crlf'Junio C Hamano Mon, 19 Dec 2016 22:45:30 +0000 (14:45 -0800)

Merge branch 'jc/renormalize-merge-kill-safer-crlf'

Fix a corner case in merge-recursive regression that crept in
during 2.10 development cycle.

* jc/renormalize-merge-kill-safer-crlf:
convert: git cherry-pick -Xrenormalize did not work
merge-recursive: handle NULL in add_cacheinfo() correctly
cherry-pick: demonstrate a segmentation fault

Merge branch 'jt/use-trailer-api-in-commands'Junio C Hamano Mon, 19 Dec 2016 22:45:29 +0000 (14:45 -0800)

Merge branch 'jt/use-trailer-api-in-commands'

Commands that operate on a log message and add lines to the trailer
blocks, such as "format-patch -s", "cherry-pick (-x|-s)", and
"commit -s", have been taught to use the logic of and share the
code with "git interpret-trailer".

* jt/use-trailer-api-in-commands:
sequencer: use trailer's trailer layout
trailer: have function to describe trailer layout
trailer: avoid unnecessary splitting on lines
commit: make ignore_non_trailer take buf/len
trailer: be stricter in parsing separators

git-p4: fix multi-path changelist empty commitsGeorge Vanburgh Sat, 17 Dec 2016 22:11:23 +0000 (22:11 +0000)

git-p4: fix multi-path changelist empty commits

When importing from multiple perforce paths - we may attempt to
import a changelist that contains files from two (or more) of these
depot paths. Currently, this results in multiple git commits - one
containing the changes, and the other(s) as empty commit(s). This
behavior was introduced in commit 1f90a64891 ("git-p4: reduce number
of server queries for fetches", 2015-12-19).

Reproduction Steps:

1. Have a git repo cloned from a perforce repo using multiple
depot paths (e.g. //depot/foo and //depot/bar).

2. Submit a single change to the perforce repo that makes changes
in both //depot/foo and //depot/bar.

3. Run "git p4 sync" to sync the change from #2.

Change is synced as multiple commits, one for each depot path that
was affected.

Using a set, instead of a list inside p4ChangesForPaths() ensures
that each changelist is unique to the returned list, and therefore
only a single commit is generated for each changelist.

Reported-by: James Farwell <jfarwell@vmware.com>
Signed-off-by: George Vanburgh <gvanburgh@bloomberg.net>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: avoid crash adding symlinked directoryLuke Diamand Sat, 17 Dec 2016 01:00:40 +0000 (01:00 +0000)

git-p4: avoid crash adding symlinked directory

When submitting to P4, if git-p4 came across a symlinked
directory, then during the generation of the submit diff, it would
try to open it as a normal file and fail.

Spot symlinks (of any type) and output a description of the symlink
instead.

Add a test case.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021: fix flaky testLars Schneider Sun, 18 Dec 2016 12:37:48 +0000 (13:37 +0100)

t0021: fix flaky test

t0021.15 creates files, adds them to the index, and commits them. All
this usually happens in a test run within the same second and Git cannot
know if the files have been changed between `add` and `commit`. Thus,
Git has to run the clean filter in both operations. Sometimes these
invocations spread over two different seconds and Git can infer that the
files were not changed between `add` and `commit` based on their
modification timestamp. The test would fail as it expects the filter
invocation. Remove this expectation to make the test stable.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

First batch for 2.12Junio C Hamano Fri, 16 Dec 2016 23:30:13 +0000 (15:30 -0800)

First batch for 2.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ls/p4-retry-thrice'Junio C Hamano Fri, 16 Dec 2016 23:27:50 +0000 (15:27 -0800)

Merge branch 'ls/p4-retry-thrice'

* ls/p4-retry-thrice:
git-p4: add config to retry p4 commands; retry 3 times by default

Merge branch 'ls/p4-empty-file-on-lfs'Junio C Hamano Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)

Merge branch 'ls/p4-empty-file-on-lfs'

"git p4" LFS support was broken when LFS stores an empty blob.

* ls/p4-empty-file-on-lfs:
git-p4: fix empty file processing for large file system backend GitLFS

Merge branch 'ld/p4-update-shelve'Junio C Hamano Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)

Merge branch 'ld/p4-update-shelve'

* ld/p4-update-shelve:
git-p4: support updating an existing shelved changelist

Merge branch 'vk/p4-submit-shelve'Junio C Hamano Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)

Merge branch 'vk/p4-submit-shelve'

* vk/p4-submit-shelve:
git-p4: allow submit to create shelved changelists.

Merge branch 'da/mergetool-trust-exit-code'Junio C Hamano Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)

Merge branch 'da/mergetool-trust-exit-code'

mergetool.<tool>.trustExitCode configuration variable did not apply
to built-in tools, but now it does.

* da/mergetool-trust-exit-code:
mergetools/vimdiff: trust Vim's exit code
mergetool: honor mergetool.$tool.trustExitCode for built-in tools

Merge branch 'ak/lazy-prereq-mktemp'Junio C Hamano Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)

Merge branch 'ak/lazy-prereq-mktemp'

Test code clean-up.

* ak/lazy-prereq-mktemp:
t7610: clean up foo.XXXXXX tmpdir

Merge branch 'nd/worktree-list-fixup'Junio C Hamano Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)

Merge branch 'nd/worktree-list-fixup'

The output from "git worktree list" was made in readdir() order,
and was unstable.

* nd/worktree-list-fixup:
worktree list: keep the list sorted
worktree.c: get_worktrees() takes a new flag argument
get_worktrees() must return main worktree as first item even on error
worktree: reorder an if statement
worktree.c: zero new 'struct worktree' on allocation

Merge branch 'nd/qsort-in-merge-recursive'Junio C Hamano Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)

Merge branch 'nd/qsort-in-merge-recursive'

Code simplification.

* nd/qsort-in-merge-recursive:
merge-recursive.c: use string_list_sort instead of qsort

Merge branch 'bw/push-dry-run'Junio C Hamano Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)

Merge branch 'bw/push-dry-run'

"git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.

* bw/push-dry-run:
push: fix --dry-run to not push submodules
push: --dry-run updates submodules when --recurse-submodules=on-demand

Merge branch 'hv/submodule-not-yet-pushed-fix'Junio C Hamano Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)

Merge branch 'hv/submodule-not-yet-pushed-fix'

The code in "git push" to compute if any commit being pushed in the
superproject binds a commit in a submodule that hasn't been pushed
out was overly inefficient, making it unusable even for a small
project that does not have any submodule but have a reasonable
number of refs.

* hv/submodule-not-yet-pushed-fix:
submodule_needs_pushing(): explain the behaviour when we cannot answer
batch check whether submodule needs pushing into one call
serialize collection of refs that contain submodule changes
serialize collection of changed submodules

Merge branch 'dt/empty-submodule-in-merge'Junio C Hamano Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)

Merge branch 'dt/empty-submodule-in-merge'

An empty directory in a working tree that can simply be nuked used
to interfere while merging or cherry-picking a change to create a
submodule directory there, which has been fixed..

* dt/empty-submodule-in-merge:
submodules: allow empty working-tree dirs in merge/cherry-pick

Merge branch 'jk/rev-parse-symbolic-parents-fix'Junio C Hamano Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)

Merge branch 'jk/rev-parse-symbolic-parents-fix'

"git rev-parse --symbolic" failed with a more recent notation like
"HEAD^-1" and "HEAD^!".

* jk/rev-parse-symbolic-parents-fix:
rev-parse: fix parent shorthands with --symbolic

index-pack: skip collision check when not in repositoryJeff King Fri, 16 Dec 2016 21:43:22 +0000 (16:43 -0500)

index-pack: skip collision check when not in repository

You can run "git index-pack path/to/foo.pack" outside of a
repository to generate an index file, or just to verify the
contents. There's no point in doing a collision check, since
we obviously do not have any objects to collide with.

The current code will blindly look in .git/objects based on
the result of setup_git_env(). That effectively gives us the
right answer (since we won't find any objects), but it's a
waste of time, and it conflicts with our desire to
eventually get rid of the "fallback to .git" behavior of
setup_git_env().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

normalize_path_copy(): fix pushing to //server/share... Johannes Sixt Wed, 14 Dec 2016 19:37:38 +0000 (20:37 +0100)

normalize_path_copy(): fix pushing to //server/share/dir on Windows

normalize_path_copy() is not prepared to keep the double-slash of a
//server/share/dir kind of path, but treats it like a regular POSIX
style path and transforms it to /server/share/dir.

The bug manifests when 'git push //server/share/dir master' is run,
because tmp_objdir_add_as_alternate() uses the path in normalized
form when it registers the quarantine object database via
link_alt_odb_entries(). Needless to say that the directory cannot be
accessed using the wrongly normalized path.

Fix it by skipping all of the root part, not just a potential drive
prefix. offset_1st_component takes care of this, see the
implementation in compat/mingw.c::mingw_offset_1st_component().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>