Commit Graph

67954 Commits

Author SHA1 Message Date
Johannes Schindelin
b5dcf93d84 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>
2017-02-03 07:20:08 +01:00
Johannes Schindelin
7bcd39f533 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>
2017-02-03 07:20:08 +01:00
Johannes Schindelin
796751dce3 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>
2017-02-03 07:20:08 +01:00
Johannes Schindelin
2e944e09e6 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>
2017-02-03 07:20:07 +01:00
Johannes Schindelin
8abcaf1398 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>
2017-02-03 07:20:07 +01:00
Johannes Schindelin
9c8e736223 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>
2017-02-03 07:20:07 +01:00
Johannes Schindelin
00c598b3f2 Start the merging-rebase to v2.11.1
This commit starts the rebase of d5251c7b08 to cb9bb09cdf
2017-02-03 07:07:40 +01:00
Junio C Hamano
3b9e3c2ced Git 2.11.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.11.1
2017-02-02 13:21:27 -08:00
Junio C Hamano
45f28edbe9 Merge branch 'ws/request-pull-code-cleanup' into maint
Code clean-up.

* ws/request-pull-code-cleanup:
  request-pull: drop old USAGE stuff
2017-02-02 13:20:30 -08:00
Junio C Hamano
5816d3cdfb Merge branch 'jk/execv-dashed-external' into maint
Typing ^C to pager, which usually does not kill it, killed Git and
took the pager down as a collateral damage in certain process-tree
structure.  This has been fixed.

* jk/execv-dashed-external:
  execv_dashed_external: wait for child on signal death
  execv_dashed_external: stop exiting with negative code
  execv_dashed_external: use child_process struct
2017-02-02 13:20:29 -08:00
Johannes Schindelin
592e5c5bce Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2017-02-01 16:35:30 +01:00
Johannes Schindelin
24f1dc2825 mingw: allow hooks to be .exe files
This change is necessary to allow the files in .git/hooks/ to optionally
have the file extension `.exe` on Windows, as the file names are
hardcoded otherwise.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2017-02-01 16:35:30 +01:00
Johannes Schindelin
fd85c21269 Merge pull request #1032 from max630/gitgui_GIT_GIT_unset
git-gui: correctly restore GIT_DIR after invoking commands
2017-02-01 16:35:29 +01:00
Johannes Schindelin
b0e652c95d Merge branch 'test-unc-alternates'
The fix we introduced in Git for Windows will be made obsolete by a more
general fix that has been already accepted into upstream Git's `next`
branch.

But we still can introduce a regression test that verifies that this bug
will be caught very quickly, if reintroduced.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:29 +01:00
Johannes Schindelin
3314795136 t9001: work around hard-to-debug hangs
Just like the workaround we added for t9116, t9001.83 hangs sometimes --
but not always! -- when being run in the Git for Windows SDK.

The issue seems to be related to redirection via a pipe, but it is really
hard to diagnose, what with git.exe (a non-MSYS2 program) calling a Perl
script (which is executed by an MSYS2 Perl), piping into another MSYS2
program.

As hunting time is scarce these days, simply work around this for now and
leave the real diagnosis and resolution for later.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:23 +01:00
Johannes Schindelin
af8af7ccc5 t5580: verify that alternates can be UNC paths
On Windows, UNC paths are a very convenient way to share data, and
alternates are all about sharing data.

We fixed a bug where alternates specifying UNC paths were not handled
properly, and it is high time that we add a regression test to ensure
that this bug is not reintroduced.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:23 +01:00
Johannes Schindelin
3951de4040 t9116: work around hard-to-debug hangs
As of a couple of weeks ago, t9116 hangs sometimes -- but not always! --
when being run in the Git for Windows SDK.

The issue seems to be related to redirection via a pipe, but it is really
hard to diagnose, what with git.exe (a non-MSYS2 program) calling a Perl
script (which is executed by an MSYS2 Perl), piping into another MSYS2
program.

As hunting time is scarce these days, simply work around this for now and
leave the real diagnosis and resolution for later.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:23 +01:00
Johannes Schindelin
ca61da3aa3 Merge branch 'interactive-rebase-current'
This series of branches introduces the git-rebase--helper, a builtin
helping to accelerate the interactive rebase dramatically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:22 +01:00
Johannes Schindelin
3425d20e6c Merge branch 'builtin-difftool-v4'
This topic branch brings the new, experimental builtin version of the
difftool into Git for Windows' master branch.

It still hands off to the legacy Perl script unless the feature flag is
flipped: only when the config setting difftool.useBuiltin is set to true
will `git difftool` actually use the experimental builtin. The idea is to
play it safe for the majority of users, but to allow heavy difftool users
to test early and to help make the builtin robust, before we actually
retire the Perl script.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:22 +01:00
Johannes Schindelin
72b496887e Merge pull request #1006 from segevfiner/git-ssh-command-putty
connect: recognize [tortoise]plink in GIT_SSH_COMMAND
2017-02-01 16:35:21 +01:00
Segev Finer
02bfb59b35 connect: Add the envvar GIT_SSH_VARIANT and ssh.variant config
This environment variable and configuration value allow to
override the autodetection of plink/tortoiseplink in case that
Git gets it wrong.

[jes: wrapped overly-long lines, factored out and changed
get_ssh_variant() to handle_ssh_variant() to accomodate the
change from the putty/tortoiseplink variables to
port_option/needs_batch, adjusted the documentation, free()d
value obtained from the config.]

Signed-off-by: Segev Finer <segev208@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:04 +01:00
Johannes Schindelin
8c7097fcc7 git_connect(): factor out SSH variant handling
We handle plink and tortoiseplink as OpenSSH replacements, by passing
the correct command-line options when detecting that they are used.

To let users override that auto-detection (in case Git gets it wrong),
we need to introduce new code to that end.

In preparation for this code, let's factor out the SSH variant handling
into its own function, handle_ssh_variant().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:04 +01:00
Junio C Hamano
d3b4dbecf5 connect: rename tortoiseplink and putty variables
One of these two may have originally been named after "what exact
SSH implementation do we have" so that we can tweak the command line
options, but these days "putty=1" no longer means "We are using the
plink SSH implementation that comes with PuTTY".  It is set when we
guess that either PuTTY plink or Tortoiseplink is in use.

Rename them after what effect is desired.  The current "putty"
option is about using "-P <port>" when OpenSSH would use "-p <port>",
so rename it to port_option whose value is either 'p' or 'P".  The
other one is about passing an extra command line option "-batch",
so rename it needs_batch.

[jes: wrapped overly-long line]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:04 +01:00
Segev Finer
efaf9e073c connect: handle putty/plink also in GIT_SSH_COMMAND
Git for Windows has special support for the popular SSH client PuTTY:
when using PuTTY's non-interactive version ("plink.exe"), we use the -P
option to specify the port rather than OpenSSH's -p option. TortoiseGit
ships with its own, forked version of plink.exe, that adds support for
the -batch option, and for good measure we special-case that, too.

However, this special-casing of PuTTY only covers the case where the
user overrides the SSH command via the environment variable GIT_SSH
(which allows specifying the name of the executable), not
GIT_SSH_COMMAND (which allows specifying a full command, including
additional command-line options).

When users want to pass any additional arguments to (Tortoise-)Plink,
such as setting a private key, they are required to either use a shell
script named plink or tortoiseplink or duplicate the logic that is
already in Git for passing the correct style of command line arguments,
which can be difficult, error prone and annoying to get right.

This patch simply reuses the existing logic and expands it to cover
GIT_SSH_COMMAND, too.

Note: it may look a little heavy-handed to duplicate the entire
command-line and then split it, only to extract the name of the
executable. However, this is not a performance-critical code path, and
the code is much more readable this way.

Signed-off-by: Segev Finer <segev208@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:04 +01:00
Johannes Schindelin
db9ebc61cb Merge branch 'unc-paths'
A bug fix for pushing to shared folders (fixing a regression introduced
into v2.11.0).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:03 +01:00
Johannes Sixt
e84f2550c0 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().

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

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:02 +01:00
Johannes Schindelin
e3a728794e mingw: demonstrate a regression pushing to UNC paths
On Windows, there are "UNC paths" to access network (AKA shared) folders,
of the form \\server\sharename\directory. This provides a convenient way
for Windows developers to share their Git repositories without having to
have a dedicated server.

Git for Windows v2.11.0 introduced a regression where pushing to said UNC
paths no longer works, although fetching and cloning still does.

Demonstrate what is the problem, using so-called "administrative shares":
disk volumes are automatically shared under certain circumstances, e.g.
the C: drive is shared as \\localhost\c$. The test needs to be skipped if
the current directory is inaccessible via said administrative share, of
course.

Original-report: https://github.com/git-for-windows/git/issues/979
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:02 +01:00
Johannes Schindelin
88503023fc Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2017-02-01 16:35:01 +01:00
Johannes Schindelin
720c2af71d Merge pull request #1004 from whoisj/nolock-env
Carry non-locking status value in the environment.
2017-02-01 16:35:00 +01:00
Johannes Schindelin
860e2bac2f Merge 'gettickcount64' into HEAD
These two patches are really a fixup to PR #1004.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:35:00 +01:00
Jeff Hostetler
f73ca3b67d diffcore-rename: speed up register_rename_src
Teach register_rename_src() to see if new file pair
can simply be appended to the rename_src[] array before
performing the binary search to find the proper insertion
point.

This is a performance optimization.  This routine is called
during run_diff_files in status and the caller is iterating
over the sorted index, so we should expect to be able to
append in the normal case.  The existing insert logic is
preserved so we don't have to assume that, but simply take
advantage of it if possible.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:34:58 +01:00
J Wyman
b49c5315b7 Carry non-locking status value in the environment.
If the user has specified '--no-lock-index' when calling git-status, it only seems reasonable that the user intends that option to be carried through to any child forks/procs as well. Currently, the '--no-lock-status' call is lost when submodules are checked. This change places the desired option into the environment, which is in turn passed down to all subsequent children.

With cmd_status checking for '--no-lock--status' first from args then from environment, we're able to keep the option set in all children.

Signed-off-by: J Wyman <jeremy.wyman@microsoft.com>
2017-02-01 16:34:57 +01:00
Johannes Schindelin
a23c7acc0f poll: lazy-load GetTickCount64()
This fixes the compilation, actually, as we still did not make the jump to
post-Windows XP completely: we still compile with _WIN32_WINNT set to
0x0502 (which corresponds to Windows Server 2003 and is technically
greater than Windows XP's 0x0501).

However, GetTickCount64() is only available starting with Windows
Vista/Windows Server 2008.

Let's just lazy-load the function, which should also help Git for Windows
contributors who want to reinstate Windows XP support.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:57 +01:00
Johannes Schindelin
6ae42d88f9 Merge pull request #1003 from shoelzer/master
poll: Use GetTickCount64 to avoid wraparound issues
2017-02-01 16:34:56 +01:00
Steve Hoelzer
04cab47b05 poll: Use GetTickCount64 to avoid wraparound issues
From Visual Studio 2015 Code Analysis: Warning C28159 Consider using
'GetTickCount64' instead of 'GetTickCount'.

Reason: GetTickCount overflows roughly every 49 days. Code that does not
take that into account can loop indefinitely. GetTickCount64 operates on
64 bit values and does not have that problem.

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
2017-02-01 16:34:55 +01:00
Johannes Schindelin
1a50302ddf Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2017-02-01 16:34:54 +01:00
Johannes Schindelin
1e604c2350 Merge branch 'http-empty-auth'
This topic branch fixes a rather serious regression with NTLM
authentication: when using "empty credentials", i.e. when inserting ":@"
into a URL (e.g. https://:@me.visualstudio.com/), we used to ask cURL to
use the login credentials. But a recent change broke that. Which this
branch fixes again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:53 +01:00
Johannes Schindelin
0fa0f1e4f9 Merge pull request #991 from jeffhostetler/jeffhostetler/string_list_realloc
string-list: use ALLOC_GROW macro when reallocing string_list
2017-02-01 16:34:53 +01:00
Johannes Schindelin
c3c37619a7 Merge pull request #988 from jeffhostetler/jeffhostetler/quick_add_index_entry
read-cache: speed up add_index_entry during checkout
2017-02-01 16:34:52 +01:00
Johannes Schindelin
b767e823c9 Support Vagrant: quick & easy Linux virtual machine setup
When developing Git for Windows, we always have to ensure that we do not
break any non-Windows platforms, e.g. by introducing Windows-specific code
into the platform-independent source code.

At other times, it is necessary to test whether a bug is Windows-specific
or not, in order to send the bug report to the correct place. Having
access to a Linux-based Git comes in really handy in such a situation.

Vagrant offers a painless way to install and use a defined Linux
development environment on Windows (and other Operating Systems). We offer
a Vagrantfile to that end for two reasons:

1) To allow Windows users to gain the full power of Linux' Git

2) To offer users an easy path to verify that the issue they are about
   to report is really a Windows-specific issue; otherwise they would
   need to report it to git@vger.kernel.org instead.

Using it is easy: Download and install https://www.virtualbox.org/, then
download and install https://www.vagrantup.com/, then direct your
command-line window to the Git source directory containing the Vagrantfile
and run the commands:

	vagrant up
	vagrant ssh

See https://github.com/git-for-windows/git/wiki/Vagrant for details.

As part of switching Git for Windows' development environment from msysGit
to the MSys2-based Git SDK, this Vagrantfile was copy-edited from msysGit:

	https://github.com/msysgit/msysgit/blob/0be8f2208/Vagrantfile

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:50 +01:00
Jeff Hostetler
8194f4d184 string-list: use ALLOC_GROW macro when reallocing string_list
Use ALLOC_GROW() macro when reallocing a string_list array
rather than simply increasing it by 32.  This is a performance
optimization.

During status on a very large repo and there are many changes,
a significant percentage of the total run time was spent
reallocing the wt_status.changes array.

This change decreased the time in wt_status_collect_changes_worktree()
from 125 seconds to 45 seconds on my very large repository.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:34:48 +01:00
Johannes Schindelin
96a1f895c5 Merge pull request #978 from jeffhostetler/jeffhostetler/thread_verify_hdr
read-cache: run verify_hdr() in background thread
2017-02-01 16:34:47 +01:00
Johannes Schindelin
b8cb767fe2 Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:46 +01:00
Johannes Schindelin
80aedfeb89 Merge branch 'visual-studio'
This topic branch teaches the project generator to generate a Visual
Studio solution, ready to be opened in Visual Studio 2010 or later.

The idea, of course, is to let some automatic build job generate and
commit the project files with

	make MSVC=1 vcxproj

and then (force-)push to a special-purpose branch.

The major part of this branch thicket concerns itself not only with
generating the Visual Studio project files, but making sure that the
user can then run the test suite from a regular Git Bash (i.e. *not*
requiring a Git for Windows SDK), e.g. by running

	cd t
	prove --timer --jobs 15 ./t[0-9]*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:46 +01:00
Johannes Schindelin
6ad3bc08fd Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2017-02-01 16:34:45 +01:00
Johannes Schindelin
0267fa9ced Merge pull request #964 from jeffhostetler/jeffhostetler/memihash_perf
Jeffhostetler/memihash perf
2017-02-01 16:34:44 +01:00
Johannes Schindelin
90dd20f605 mingw: make readlink() independent of core.symlinks
Regardless whether we think we are able to create symbolic links, we
should always read them.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:44 +01:00
Johannes Schindelin
0568f2ab25 Merge pull request #955 from jeffhostetler/jeffhostetler/preload_index_perf
preload-index: avoid lstat for skip-worktree items
2017-02-01 16:34:43 +01:00
Johannes Schindelin
5d393e4ce6 Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2017-02-01 16:34:43 +01:00
Johannes Schindelin
9640cf2566 Merge branch 'reset-stdin'
This topic branch adds the (experimental) --stdin/-z options to `git
reset`. Those patches are still under review in the upstream Git project,
but are already merged in their experimental form into Git for Windows'
`master` branch, in preparation for a MinGit-only release.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:42 +01:00