<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-add--interactive.perl, branch v2.26.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.26.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.26.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2019-12-06T16:57:34Z</updated>
<entry>
<title>git add -p: use non-zero exit code when the diff generation failed</title>
<updated>2019-12-06T16:57:34Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2019-12-06T13:08:24Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=89c8559367aae771006cc0956b6f5e54cc8c614c'/>
<id>urn:sha1:89c8559367aae771006cc0956b6f5e54cc8c614c</id>
<content type='text'>
The first thing `git add -p` does is to generate a diff. If this diff
cannot be generated, `git add -p` should not continue as if nothing
happened, but instead fail.

What we *actually* do here is much broader: we now verify for *every*
`run_cmd_pipe()` call that the spawned process actually succeeded.

Note that we have to change two callers in this patch, as we need to
store the spawned process' output in a local variable, which means that
the callers can no longer decide whether to interpret the `return &lt;$fh&gt;`
in array or in scalar context.

This bug was noticed while writing a test case for the diff.algorithm
feature, and we let that test case double as a regression test for this
fixed bug, too.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add -i: show progress counter in the prompt</title>
<updated>2019-10-03T22:12:19Z</updated>
<author>
<name>Kunal Tyagi</name>
<email>tyagi.kunal@live.com</email>
</author>
<published>2019-09-30T05:22:59Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=8085050ab4e29f442f305e338e6eea750540190e'/>
<id>urn:sha1:8085050ab4e29f442f305e338e6eea750540190e</id>
<content type='text'>
Report the current hunk count and total number of hunks for the
current file in the prompt.  Also adjust the expected output in
some tests to match.

Signed-off-by: Kunal Tyagi &lt;tyagi.kunal@live.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/switch-and-restore'</title>
<updated>2019-07-09T22:25:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-09T22:25:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f496b064fc1135e0dded7f93d85d72eb0b302c22'/>
<id>urn:sha1:f496b064fc1135e0dded7f93d85d72eb0b302c22</id>
<content type='text'>
Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.

* nd/switch-and-restore: (46 commits)
  completion: disable dwim on "git switch -d"
  switch: allow to switch in the middle of bisect
  t2027: use test_must_be_empty
  Declare both git-switch and git-restore experimental
  help: move git-diff and git-reset to different groups
  doc: promote "git restore"
  user-manual.txt: prefer 'merge --abort' over 'reset --hard'
  completion: support restore
  t: add tests for restore
  restore: support --patch
  restore: replace --force with --ignore-unmerged
  restore: default to --source=HEAD when only --staged is specified
  restore: reject invalid combinations with --staged
  restore: add --worktree and --staged
  checkout: factor out worktree checkout code
  restore: disable overlay mode by default
  restore: make pathspec mandatory
  restore: take tree-ish from --source option instead
  checkout: split part of it to new command 'restore'
  doc: promote "git switch"
  ...
</content>
</entry>
<entry>
<title>Merge branch 'pw/add-p-recount'</title>
<updated>2019-07-09T22:25:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-09T22:25:37Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1b074e15d0f976be2bc14f9528874a841c055213'/>
<id>urn:sha1:1b074e15d0f976be2bc14f9528874a841c055213</id>
<content type='text'>
"git checkout -p" needs to selectively apply a patch in reverse,
which did not work well.

* pw/add-p-recount:
  add -p: fix checkout -p with pathological context
</content>
</entry>
<entry>
<title>add -p: fix checkout -p with pathological context</title>
<updated>2019-06-13T17:00:30Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2019-06-12T09:25:27Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2bd69b9024c8c7c1b77060e3ed996c74b4775b01'/>
<id>urn:sha1:2bd69b9024c8c7c1b77060e3ed996c74b4775b01</id>
<content type='text'>
Commit fecc6f3a68 ("add -p: adjust offsets of subsequent hunks when one is
skipped", 2018-03-01) fixed adding hunks in the correct place when a
previous hunk has been skipped. However it did not address patches that
are applied in reverse. In that case we need to adjust the pre-image
offset so that when apply reverses the patch the post-image offset is
adjusted correctly. We subtract rather than add the delta as the patch
is reversed (the easiest way to think about it is to consider a hunk of
deletions that is skipped - in that case we want to reduce offset so we
need to subtract).

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>restore: support --patch</title>
<updated>2019-05-07T04:04:47Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-04-25T09:45:54Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2f0896ec3ad4731d970d22f61daf62046bc766a9'/>
<id>urn:sha1:2f0896ec3ad4731d970d22f61daf62046bc766a9</id>
<content type='text'>
git-restore is different from git-checkout that it only restores the
worktree by default, not both worktree and index. add--interactive
needs some update to support this mode.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/add-p-recount'</title>
<updated>2018-06-28T19:53:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-06-28T19:53:32Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=5eb8da850860839bdf38ab80079eb8875b764431'/>
<id>urn:sha1:5eb8da850860839bdf38ab80079eb8875b764431</id>
<content type='text'>
When user edits the patch in "git add -p" and the user's editor is
set to strip trailing whitespaces indiscriminately, an empty line
that is unchanged in the patch would become completely empty
(instead of a line with a sole SP on it).  The code introduced in
Git 2.17 timeframe failed to parse such a patch, but now it learned
to notice the situation and cope with it.

* pw/add-p-recount:
  add -p: fix counting empty context lines in edited patches
</content>
</entry>
<entry>
<title>add -p: fix counting empty context lines in edited patches</title>
<updated>2018-06-11T16:45:19Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2018-06-11T09:46:02Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f4d35a6b49621348c73222e7017a434551799308'/>
<id>urn:sha1:f4d35a6b49621348c73222e7017a434551799308</id>
<content type='text'>
recount_edited_hunk() introduced in commit 2b8ea7f3c7 ("add -p:
calculate offset delta for edited patches", 2018-03-05) required all
context lines to start with a space, empty lines are not counted. This
was intended to avoid any recounting problems if the user had
introduced empty lines at the end when editing the patch. However this
introduced a regression into 'git add -p' as it seems it is common for
editors to strip the trailing whitespace from empty context lines when
patches are edited thereby introducing empty lines that should be
counted. 'git apply' knows how to deal with such empty lines and POSIX
states that whether or not there is an space on an empty context line
is implementation defined [1].

Fix the regression by counting lines that consist solely of a newline
as well as lines starting with a space as context lines and add a test
to prevent future regressions.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html

Reported-by: Mahmoud Al-Qudsi &lt;mqudsi@neosmart.net&gt;
Reported-by: Oliver Joseph Ash &lt;oliverjash@gmail.com&gt;
Reported-by: Jeff Felchner &lt;jfelchner1@gmail.com&gt;
Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add--interactive: compute the empty tree value</title>
<updated>2018-05-02T04:59:53Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-05-02T00:26:09Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=23ec4c51d53f6976bdb54e92487d378f9abd1ed3'/>
<id>urn:sha1:23ec4c51d53f6976bdb54e92487d378f9abd1ed3</id>
<content type='text'>
The interactive add script hard-codes the object ID of the empty tree.
To avoid any problems when changing hashes, compute this value when used
and cache it for any future uses.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/add-p-single'</title>
<updated>2018-04-02T17:10:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-04-02T17:10:54Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=5f9441769fab51afc9fc96d1e5f7a9edde586088'/>
<id>urn:sha1:5f9441769fab51afc9fc96d1e5f7a9edde586088</id>
<content type='text'>
Hotfix.

* pw/add-p-single:
  add -p: fix 2.17.0-rc* regression due to moved code
</content>
</entry>
</feed>
