<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-add--interactive.perl, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-07-09T22:25:44Z</updated>
<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://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://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://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://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://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://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://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://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>
<entry>
<title>add -p: fix 2.17.0-rc* regression due to moved code</title>
<updated>2018-04-01T04:54:28Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-03-31T12:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd2fb4aa0cc2a25a8e4ddf3f3c48880f317edcf4'/>
<id>urn:sha1:fd2fb4aa0cc2a25a8e4ddf3f3c48880f317edcf4</id>
<content type='text'>
Fix a regression in 88f6ffc1c2 ("add -p: only bind search key if
there's more than one hunk", 2018-02-13) which is present in
2.17.0-rc*, but not 2.16.0.

In Perl, regex variables like $1 always refer to the last regex
match. When the aforementioned change added a new regex match between
the old match and the corresponding code that was expecting $1, the $1
variable would always be undef, since the newly inserted regex match
doesn't have any captures.

As a result the "/" feature to search for a string in a hunk by regex
completely broke, on git.git:

    $ perl -pi -e 's/Git/Tig/g' README.md
    $ ./git --exec-path=$PWD add -p
    [..]
    Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? s
    Split into 4 hunks.
    [...]
    Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? /Many
    Use of uninitialized value $1 in string eq at /home/avar/g/git/git-add--interactive line 1568, &lt;STDIN&gt; line 1.
    search for regex? Many

I.e. the initial "/regex" command wouldn't work, and would always emit
a warning and ask again for a regex, now it works as intended again.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/add-i-diff-filter'</title>
<updated>2018-03-14T19:01:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-14T19:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5e2df04ac9dd731c729c6159d58c2288d794858'/>
<id>urn:sha1:c5e2df04ac9dd731c729c6159d58c2288d794858</id>
<content type='text'>
The "interactive.diffFilter" used by "git add -i" must retain
one-to-one correspondence between its input and output, but it was
not enforced and caused end-user confusion.  We now at least make
sure the filtered result has the same number of lines as its input
to detect a broken filter.

* jk/add-i-diff-filter:
  add--interactive: detect bogus diffFilter output
  t3701: add a test for interactive.diffFilter
</content>
</entry>
</feed>
