<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-add--interactive.perl, branch v2.3.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-02-25T06:10:42Z</updated>
<entry>
<title>Merge branch 'ak/add-i-empty-candidates' into maint</title>
<updated>2015-02-25T06:10:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-25T06:10:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7bc4c01d9b66b4bc5ef1a7d77a6743ca135ea680'/>
<id>urn:sha1:7bc4c01d9b66b4bc5ef1a7d77a6743ca135ea680</id>
<content type='text'>
The interactive "show a list and let the user choose from it"
interface "add -i" used showed and prompted to the user even when
the candidate list was empty, against which the only "choice" the
user could have made was to choose nothing.

* ak/add-i-empty-candidates:
  add -i: return from list_and_choose if there is no candidate
</content>
</entry>
<entry>
<title>add -i: return from list_and_choose if there is no candidate</title>
<updated>2015-01-22T22:44:36Z</updated>
<author>
<name>Alexander Kuleshov</name>
<email>kuleshovmail@gmail.com</email>
</author>
<published>2015-01-22T08:39:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9c4641df7989c9adf6af471705ebf735c35a92f'/>
<id>urn:sha1:a9c4641df7989c9adf6af471705ebf735c35a92f</id>
<content type='text'>
The list_and_choose() helper is given a prompt and a list, asks the
user to make selection from the list, and then returns a list of
items chosen.  Even when it is given an empty list as the original
candidate set to choose from, it gave a prompt to the user, who can
only say "I am done choosing".

Return an empty result when the input is an empty list without
bothering the user.  The existing caller must already have a logic
to say "Nothing to do" or an equivalent when the returned list is
empty (i.e. the user chose to select nothing) if it is necessary, so
no change to the callers is necessary.

This fixes the case where "add untracked" is asked in "git add -i"
and there is no untracked files in the working tree.  We used to give
an empty list of files to choose from with a prompt, but with this
change, we no longer do.

Signed-off-by: Alexander Kuleshov &lt;kuleshovmail@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: leave main loop on read error</title>
<updated>2014-12-15T18:12:20Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-15T16:35:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8bec7abcc78db991026ed20e16edf46141d6a77'/>
<id>urn:sha1:a8bec7abcc78db991026ed20e16edf46141d6a77</id>
<content type='text'>
The main hunk loop for add--interactive will loop if it does
not get a known input. This is a good thing if the user
typed some invalid input. However, if we have an
uncorrectable read error, we'll end up looping infinitely.
We can fix this by noticing read errors (i.e., &lt;STDIN&gt;
returns undef) and breaking out of the loop.

One easy way to trigger this is if you have an editor that
does not take over the terminal (e.g., one that spawns a
window in an existing process and waits), start the editor
with the hunk-edit command, and hit ^C to send SIGINT. The
editor process dies due to SIGINT, but the perl
add--interactive process does not (perl suspends SIGINT for
the duration of our system() call).

We return to the main loop, but further reads from stdin
don't work. The SIGINT _also_ killed our parent git process,
which orphans our process group, meaning that further reads
from the terminal will always fail. We loop infinitely,
getting EIO on each read.

Note that there are several other spots where we read from
stdin, too. However, in each of those cases, we do something
sane when the read returns undef (breaking out of the loop,
taking the input as "no", etc). They don't need similar
treatment.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jl/nor-or-nand-and'</title>
<updated>2014-04-08T19:00:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-08T19:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d59c12d7ad39f942fc60578ba1e934822f40445b'/>
<id>urn:sha1:d59c12d7ad39f942fc60578ba1e934822f40445b</id>
<content type='text'>
Eradicate mistaken use of "nor" (that is, essentially "nor" used
not in "neither A nor B" ;-)) from in-code comments, command output
strings, and documentations.

* jl/nor-or-nand-and:
  code and test: fix misuses of "nor"
  comments: fix misuses of "nor"
  contrib: fix misuses of "nor"
  Documentation: fix misuses of "nor"
</content>
</entry>
<entry>
<title>code and test: fix misuses of "nor"</title>
<updated>2014-03-31T22:29:33Z</updated>
<author>
<name>Justin Lebar</name>
<email>jlebar@google.com</email>
</author>
<published>2014-03-31T22:11:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=235e8d591480d7e1378c27fe65c5529625d4b5be'/>
<id>urn:sha1:235e8d591480d7e1378c27fe65c5529625d4b5be</id>
<content type='text'>
Signed-off-by: Justin Lebar &lt;jlebar@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-add--interactive: warn if module for interactive.singlekey is missing</title>
<updated>2014-03-03T22:11:18Z</updated>
<author>
<name>Simon Ruderich</name>
<email>simon@ruderich.org</email>
</author>
<published>2014-03-03T21:16:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b294097bc64b056685c938c338f047be0c0771d8'/>
<id>urn:sha1:b294097bc64b056685c938c338f047be0c0771d8</id>
<content type='text'>
Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Simon Ruderich &lt;simon@ruderich.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add-interactive: handle unborn branch in patch mode</title>
<updated>2013-10-25T21:54:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-10-25T06:52:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=954312a3ff76652a954b730ae69a031f98293a99'/>
<id>urn:sha1:954312a3ff76652a954b730ae69a031f98293a99</id>
<content type='text'>
The list_modified function already knows how to handle an
unborn branch by diffing against the empty tree. However,
the diff we perform to get the actual hunks does not. Let's
use the same logic for both diffs.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: fix external command invocation on Windows</title>
<updated>2013-09-04T17:35:25Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2013-09-04T07:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df17e77c0aacca35eaaac885fe70d97654c07d62'/>
<id>urn:sha1:df17e77c0aacca35eaaac885fe70d97654c07d62</id>
<content type='text'>
Back in 21e9757e (Hack git-add--interactive to make it work with
ActiveState Perl, 2007-08-01), the invocation of external commands was
changed to use qx{} on Windows. The rationale was that the command
interpreter on Windows is not a POSIX shell, but rather Windows's CMD.
That patch was wrong to include 'msys' in the check whether to use qx{}
or not: 'msys' identifies MSYS perl as shipped with Git for Windows,
which does not need the special treatment; qx{} should be used only with
ActiveState perl, which is identified by 'MSWin32'.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add -i: add extra options at the right place in "diff" command line</title>
<updated>2013-06-23T20:39:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-06-23T19:19:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5c29097826be86e2f18139491cdf9c830c7fa3e'/>
<id>urn:sha1:e5c29097826be86e2f18139491cdf9c830c7fa3e</id>
<content type='text'>
Appending "--diff-algorithm=histogram" at the end of canned command
line for various modes of "diff" is correct for most of them but not
for "stash" that has a non-option already wired in, like so:

	'stash' =&gt; {
		DIFF =&gt; 'diff-index -p HEAD',

Appending an extra option after non-option may happen to work due to
overly lax command line parser, but that is not something we should
rely on.  Instead, splice in the extra argument immediately after the
command name (i.e. 'diff-index', 'diff-files', etc.).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: respect diff.algorithm</title>
<updated>2013-06-12T20:41:19Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2013-06-12T18:44:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2cc0f53b53e7d5456ec45713a201142754d69249'/>
<id>urn:sha1:2cc0f53b53e7d5456ec45713a201142754d69249</id>
<content type='text'>
When staging hunks interactively it is sometimes useful to use an
alternative diff algorithm which splits the changes into hunks in a more
logical manner.  This is not possible because the plumbing commands
called by add--interactive ignore the "diff.algorithm" configuration
option (as they should).

Since add--interactive is a porcelain command it should respect this
configuration variable.  To do this, make it read diff.algorithm and
pass its value to the underlying diff-index and diff-files invocations.

At this point, do not add options to "git add", "git reset" or "git
checkout" (all of which can call git-add--interactive).  If a user
wants to override the value on the command line they can use:

	git -c diff.algorithm=$ALGO ...

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
