<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-add--interactive.perl, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-06-16T18:38:58Z</updated>
<entry>
<title>add--interactive: respect diff.compactionHeuristic</title>
<updated>2016-06-16T18:38:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-06-16T12:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=46e3d17f57f90538242b7a1dde126eba59f7c5ab'/>
<id>urn:sha1:46e3d17f57f90538242b7a1dde126eba59f7c5ab</id>
<content type='text'>
We use plumbing to generate the diff, so it doesn't
automatically pick up UI config like compactionHeuristic.
Let's forward it on, since interactive adding is porcelain.

Note that we only need to handle the "true" case. There's no
point in passing --no-compaction-heuristic when the variable
is false, since nothing else could have turned it on.

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: allow custom diff highlighting programs</title>
<updated>2016-02-28T18:53:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-27T05:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=01143847dbf4fbf27268650f3ace16eac03b3130'/>
<id>urn:sha1:01143847dbf4fbf27268650f3ace16eac03b3130</id>
<content type='text'>
The patch hunk selector of add--interactive knows how ask
git for colorized diffs, and correlate them with the
uncolored diffs we apply. But there's not any way for
somebody who uses a diff-filter tool like contrib's
diff-highlight to see their normal highlighting.

This patch lets users define an arbitrary shell command to
pipe the colorized diff through. The exact output shouldn't
matter (since we just show the result to humans) as long as
it is line-compatible with the original diff (so that
hunk-splitting can split the colorized version, too).

I left two minor issues with the new system that I don't
think are worth fixing right now, but could be done later:

  1. We only filter colorized diffs. Theoretically a user
     could want to filter a non-colorized diff, but I find
     it unlikely in practice. Users who are doing things
     like diff-highlighting are likely to want color, too.

  2. add--interactive will re-colorize a diff which has been
     hand-edited, but it won't have run through the filter.
     Fixing this is conceptually easy (just pipe the diff
     through the filter), but practically hard to do without
     using tempfiles (it would need to feed data to and read
     the result from the filter without deadlocking; this
     raises portability questions with respect to Windows).

I've punted on both issues for now, and if somebody really
cares later, they can do a patch on top.

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 'ak/add-i-empty-candidates'</title>
<updated>2015-02-17T18:15:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-17T18:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c1fa3e21bc3223a7b18616a374cecff70721d157'/>
<id>urn:sha1:c1fa3e21bc3223a7b18616a374cecff70721d157</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>
</feed>
