<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-am.sh, branch v2.5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.5.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-09-17T19:03:02Z</updated>
<entry>
<title>Merge branch 'js/maint-am-skip-performance-regression' into maint</title>
<updated>2015-09-17T19:03:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-17T19:03:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=02dad2673b2bea4d28ca1b79c2e40fb8ad170959'/>
<id>urn:sha1:02dad2673b2bea4d28ca1b79c2e40fb8ad170959</id>
<content type='text'>
* js/maint-am-skip-performance-regression:
  am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
</content>
</entry>
<entry>
<title>am --skip/--abort: merge HEAD/ORIG_HEAD tree into index</title>
<updated>2015-09-09T21:22:56Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2015-09-09T09:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9d66899a992525f2de9436e160779844ecfa2f1'/>
<id>urn:sha1:b9d66899a992525f2de9436e160779844ecfa2f1</id>
<content type='text'>
f8da6801 (am --skip: support skipping while on unborn branch,
2015-06-06) introduced a performance regression to "git am --skip",
where it used "read-tree" to reconstruct the index from scratch
without reusing the cached stat information.

This is a backport of the corresponding patch to the builtin am in 2.6:
3ecc704 (am --skip/--abort: merge HEAD/ORIG_HEAD tree into index,
2015-08-19).

Reportedly, it can make a huge difference on Windows, in one case a `git
rebase --skip` took 1m40s without, and 5s with, this patch.

cf. https://github.com/git-for-windows/git/issues/365

Reported-and-suggested-by: Kim Gybels &lt;kgybels@infogroep.be&gt;
Acked-by: Paul Tan &lt;pyokagan@gmail.com&gt;
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>Merge branch 'pt/am-abort-fix' into maint</title>
<updated>2015-08-03T17:41:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-03T17:41:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c36e465aca712cea70cb9570a1e7136e5de36b76'/>
<id>urn:sha1:c36e465aca712cea70cb9570a1e7136e5de36b76</id>
<content type='text'>
Various fixes around "git am" that applies a patch to a history
that is not there yet.

* pt/am-abort-fix:
  am --abort: keep unrelated commits on unborn branch
  am --abort: support aborting to unborn branch
  am --abort: revert changes introduced by failed 3way merge
  am --skip: support skipping while on unborn branch
  am -3: support 3way merge on unborn branch
  am --skip: revert changes introduced by failed 3way merge
</content>
</entry>
<entry>
<title>Revert "git-am: add am.threeWay config variable"</title>
<updated>2015-07-24T17:55:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-24T17:55:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15dc5b5fb049bdf7abdbc610a5dec040c4d499bd'/>
<id>urn:sha1:15dc5b5fb049bdf7abdbc610a5dec040c4d499bd</id>
<content type='text'>
This reverts commit d96a275b91bae1800cd43be0651e886e7e042a17.

It used to be possible to apply a patch series with "git am mbox"
and then only after seeing a failure, switch to three-way mode via
"git am -3" (no other options or arguments).  The commit being
reverted broke this workflow.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pt/am-abort-fix'</title>
<updated>2015-06-24T19:21:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-24T19:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce5e33832ae3f7224fe39d6ade4764522197bacf'/>
<id>urn:sha1:ce5e33832ae3f7224fe39d6ade4764522197bacf</id>
<content type='text'>
Various fixes around "git am" that applies a patch to a history
that is not there yet.

* pt/am-abort-fix:
  am --abort: keep unrelated commits on unborn branch
  am --abort: support aborting to unborn branch
  am --abort: revert changes introduced by failed 3way merge
  am --skip: support skipping while on unborn branch
  am -3: support 3way merge on unborn branch
  am --skip: revert changes introduced by failed 3way merge
</content>
</entry>
<entry>
<title>Merge branch 'rl/am-3way-config'</title>
<updated>2015-06-24T19:21:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-24T19:21:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b64c8a1eea6b44fb8505ec46cccf8255c7e6c63'/>
<id>urn:sha1:4b64c8a1eea6b44fb8505ec46cccf8255c7e6c63</id>
<content type='text'>
"git am" learned am.threeWay configuration variable.

* rl/am-3way-config:
  git-am: add am.threeWay config variable
  t4150-am: refactor am -3 tests
  git-am.sh: fix initialization of the threeway variable
</content>
</entry>
<entry>
<title>am --abort: keep unrelated commits on unborn branch</title>
<updated>2015-06-08T20:14:04Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-06T11:46:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6ea3b67b4e3f4a09561a26ca42af1492b3b48c95'/>
<id>urn:sha1:6ea3b67b4e3f4a09561a26ca42af1492b3b48c95</id>
<content type='text'>
Since 7b3b7e3 (am --abort: keep unrelated commits since the last failure
and warn, 2010-12-21), git-am would refuse to rewind HEAD if commits
were made since the last git-am failure. This check was implemented in
safe_to_abort(), which checked to see if HEAD's hash matched the
abort-safety file.

However, this check was skipped if the abort-safety file was empty,
which can happen if git-am failed while on an unborn branch. As such, if
any commits were made since then, they would be discarded. Fix this by
carrying on the abort safety check even if the abort-safety file is
empty.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>am --abort: support aborting to unborn branch</title>
<updated>2015-06-08T20:10:45Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-06T11:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e06764c8ebf87a80737dc0a6198a013799f18e32'/>
<id>urn:sha1:e06764c8ebf87a80737dc0a6198a013799f18e32</id>
<content type='text'>
When git-am is first run on an unborn branch, no ORIG_HEAD is created.
As such, any applied commits will remain even after a git am --abort.

To be consistent with the behavior of git am --abort when it is not run
from an unborn branch, we empty the index, and then destroy the branch
pointed to by HEAD if there is no ORIG_HEAD.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>am --abort: revert changes introduced by failed 3way merge</title>
<updated>2015-06-08T20:09:20Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-06T11:46:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20c3fe762105a29150fd21e3e0a340bca7890848'/>
<id>urn:sha1:20c3fe762105a29150fd21e3e0a340bca7890848</id>
<content type='text'>
Even when a merge conflict occurs with am --3way, the index will be
modified with the results of any successfully merged files. These
changes to the index will not be reverted with a
"git read-tree --reset -u HEAD ORIG_HEAD", as git read-tree will not be
aware of how the current index differs from HEAD or ORIG_HEAD.

To fix this, we first reset any conflicting entries in the index. The
resulting index will contain the results of successfully merged files
introduced by the failed merge. We write this index to a tree, and then
use git read-tree to fast-forward this "index tree" back to ORIG_HEAD,
thus undoing all the changes from the failed merge.

When we are on an unborn branch, HEAD and ORIG_HEAD will not point to
valid trees. In this case, use an empty tree.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>am --skip: support skipping while on unborn branch</title>
<updated>2015-06-08T20:06:44Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-06T11:46:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8da6801e2fb3e46a42031b860c6411ef76a0335'/>
<id>urn:sha1:f8da6801e2fb3e46a42031b860c6411ef76a0335</id>
<content type='text'>
When git am --skip is run, git am will copy HEAD's tree entries to the
index with "git reset HEAD". However, on an unborn branch, HEAD does not
point to a tree, so "git reset HEAD" will fail.

Fix this by treating HEAD as en empty tree when we are on an unborn
branch.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
