<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/sequencer.h, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-30T05:04:04Z</updated>
<entry>
<title>Merge branch 'js/sequencer-and-root-commits'</title>
<updated>2018-05-30T05:04:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-30T05:04:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5aa4bccb5ffcc01e45915c00d2fce30ce959dab'/>
<id>urn:sha1:c5aa4bccb5ffcc01e45915c00d2fce30ce959dab</id>
<content type='text'>
The implementation of "git rebase -i --root" has been updated to use
the sequencer machinery more.

* js/sequencer-and-root-commits:
  rebase --rebase-merges: root commits can be cousins, too
  rebase --rebase-merges: a "merge" into a new root is a fast-forward
  sequencer: allow introducing new root commits
  rebase -i --root: let the sequencer handle even the initial part
  sequencer: learn about the special "fake root commit" handling
  sequencer: extract helper to update active_cache_tree
</content>
</entry>
<entry>
<title>Merge branch 'js/rebase-recreate-merge'</title>
<updated>2018-05-23T05:38:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-23T05:38:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c18e6ae2434a6caa5b3a7256608470948e73f66'/>
<id>urn:sha1:2c18e6ae2434a6caa5b3a7256608470948e73f66</id>
<content type='text'>
"git rebase" learned "--rebase-merges" to transplant the whole
topology of commit graph elsewhere.

* js/rebase-recreate-merge:
  rebase -i --rebase-merges: add a section to the man page
  rebase -i: introduce --rebase-merges=[no-]rebase-cousins
  pull: accept --rebase=merges to recreate the branch topology
  rebase --rebase-merges: avoid "empty merges"
  sequencer: handle post-rewrite for merge commands
  sequencer: make refs generated by the `label` command worktree-local
  rebase --rebase-merges: add test for --keep-empty
  rebase: introduce the --rebase-merges option
  rebase-helper --make-script: introduce a flag to rebase merges
  sequencer: fast-forward `merge` commands, if possible
  sequencer: introduce the `merge` command
  sequencer: introduce new commands to reset the revision
  git-rebase--interactive: clarify arguments
  sequencer: offer helpful advice when a command was rescheduled
  sequencer: refactor how original todo list lines are accessed
  sequencer: make rearrange_squash() a bit more obvious
  sequencer: avoid using errno clobbered by rollback_lock_file()
</content>
</entry>
<entry>
<title>sequencer: learn about the special "fake root commit" handling</title>
<updated>2018-05-06T04:21:58Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-05-03T23:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6'/>
<id>urn:sha1:d87d48b2e033e8a8d39afbe7cb5eea331bbe47a6</id>
<content type='text'>
When an interactive rebase wants to recreate a root commit, it
- first creates a new, empty root commit,
- checks it out,
- converts the next `pick` command so that it amends the empty root
  commit

Introduce support in the sequencer to handle such an empty root commit,
by looking for the file &lt;GIT_DIR&gt;/rebase-merge/squash-onto; if it exists
and contains a commit name, the sequencer will compare the HEAD to said
root commit, and if identical, a new root commit will be created.

While converting scripted code into proper, portable C, we also do away
with the old "amend with an empty commit message, then cherry-pick
without committing, then amend again" dance and replace it with code
that uses the internal API properly to do exactly what we want: create a
new root commit.

To keep the implementation simple, we always spawn `git commit` to create
new root commits.

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>rebase -i: Handle "combination of &lt;n&gt; commits" with GETTEXT_POISON</title>
<updated>2018-05-01T22:47:47Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-04-27T20:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e12a7ef5972423c822834f9c514a54e32ea99e65'/>
<id>urn:sha1:e12a7ef5972423c822834f9c514a54e32ea99e65</id>
<content type='text'>
We previously relied on the localized versions of

	# This is a combination of &lt;N&gt; commits

(which we write into the commit messages during fixup/squash chains)
to contain &lt;N&gt; encoded in ASCII.

This is not true in general, and certainly not true when compiled with
GETTEXT_POISON=TryToKillMe, as demonstrated by the regression test we
just introduced in t3418.

So let's decouple keeping track of the count from the (localized) commit
messages by introducing a new file called 'current-fixups' that keeps
track of the current fixup/squash chain. This file contains a bit more
than just the count (it contains a list of "fixup &lt;commit&gt;"/"squash
&lt;commit&gt;" lines). This is done on purpose, as it will come in handy for
a fix for the bug where `git rebase --skip` on a final fixup/squash will
leave the commit message in limbo.

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>rebase -i: introduce --rebase-merges=[no-]rebase-cousins</title>
<updated>2018-04-26T03:28:43Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-04-25T12:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7543f6f4441a0ec76460a54f90ab8674fe424786'/>
<id>urn:sha1:7543f6f4441a0ec76460a54f90ab8674fe424786</id>
<content type='text'>
When running `git rebase --rebase-merges` non-interactively with an
ancestor of HEAD as &lt;upstream&gt; (or leaving the todo list unmodified),
we would ideally recreate the exact same commits as before the rebase.

However, if there are commits in the commit range &lt;upstream&gt;.. that do not
have &lt;upstream&gt; as direct ancestor (i.e. if `git log &lt;upstream&gt;..` would
show commits that are omitted by `git log --ancestry-path &lt;upstream&gt;..`),
this is currently not the case: we would turn them into commits that have
&lt;upstream&gt; as direct ancestor.

Let's illustrate that with a diagram:

        C
      /   \
A - B - E - F
  \   /
    D

Currently, after running `git rebase -i --rebase-merges B`, the new branch
structure would be (pay particular attention to the commit `D`):

       --- C' --
      /         \
A - B ------ E' - F'
      \    /
        D'

This is not really preserving the branch topology from before! The
reason is that the commit `D` does not have `B` as ancestor, and
therefore it gets rebased onto `B`.

This is unintuitive behavior. Even worse, when recreating branch
structure, most use cases would appear to want cousins *not* to be
rebased onto the new base commit. For example, Git for Windows (the
heaviest user of the Git garden shears, which served as the blueprint
for --rebase-merges) frequently merges branches from `next` early, and
these branches certainly do *not* want to be rebased. In the example
above, the desired outcome would look like this:

       --- C' --
      /         \
A - B ------ E' - F'
  \        /
   -- D' --

Let's introduce the term "cousins" for such commits ("D" in the
example), and let's not rebase them by default. For hypothetical
use cases where cousins *do* need to be rebased, `git rebase
--rebase=merges=rebase-cousins` needs to be used.

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>rebase-helper --make-script: introduce a flag to rebase merges</title>
<updated>2018-04-26T03:28:42Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-04-25T12:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1644c73c6d4fe35d4d3304b9c03c9586de51626f'/>
<id>urn:sha1:1644c73c6d4fe35d4d3304b9c03c9586de51626f</id>
<content type='text'>
The sequencer just learned new commands intended to recreate branch
structure (similar in spirit to --preserve-merges, but with a
substantially less-broken design).

Let's allow the rebase--helper to generate todo lists making use of
these commands, triggered by the new --rebase-merges option. For a
commit topology like this (where the HEAD points to C):

	- A - B - C
	    \   /
	      D

the generated todo list would look like this:

	# branch D
	pick 0123 A
	label branch-point
	pick 1234 D
	label D

	reset branch-point
	pick 2345 B
	merge -C 3456 D # C

To keep things simple, we first only implement support for merge commits
with exactly two parents, leaving support for octopus merges to a later
patch series.

All merge-rebasing todo lists start with a hard-coded `label onto` line.
This makes it convenient to refer later on to the revision onto which
everything is rebased, e.g. as starting point for branches other than
the very first one.

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 'pw/sequencer-in-process-commit'</title>
<updated>2018-02-13T21:39:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-13T21:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f57f731ea2a540a4c82b476054e8a36aebb2314'/>
<id>urn:sha1:0f57f731ea2a540a4c82b476054e8a36aebb2314</id>
<content type='text'>
The sequencer infrastructure is shared across "git cherry-pick",
"git rebase -i", etc., and has always spawned "git commit" when it
needs to create a commit.  It has been taught to do so internally,
when able, by reusing the codepath "git commit" itself uses, which
gives performance boost for a few tens of percents in some sample
scenarios.

* pw/sequencer-in-process-commit:
  sequencer: run 'prepare-commit-msg' hook
  t7505: add tests for cherry-pick and rebase -i/-p
  t7505: style fixes
  sequencer: assign only free()able strings to gpg_sign
  sequencer: improve config handling
  t3512/t3513: remove KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1
  sequencer: try to commit without forking 'git commit'
  sequencer: load commit related config
  sequencer: simplify adding Signed-off-by: trailer
  commit: move print_commit_summary() to libgit
  commit: move post-rewrite code to libgit
  Add a function to update HEAD after creating a commit
  commit: move empty message checks to libgit
  t3404: check intermediate squash messages
</content>
</entry>
<entry>
<title>sequencer: run 'prepare-commit-msg' hook</title>
<updated>2018-01-24T19:01:31Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2018-01-24T12:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66618a50f9c9f008d7aef751418f12ba9bfc6b85'/>
<id>urn:sha1:66618a50f9c9f008d7aef751418f12ba9bfc6b85</id>
<content type='text'>
Commit 356ee4659b ("sequencer: try to commit without forking 'git
commit'", 2017-11-24) forgot to run the 'prepare-commit-msg' hook when
creating the commit. Fix this by writing the commit message to a
different file and running the hook. Using a different file means that
if the commit is cancelled the original message file is
unchanged. Also move the checks for an empty commit so the order
matches 'git commit'.

Reported-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.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>sequencer: improve config handling</title>
<updated>2017-12-13T19:15:14Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2017-12-13T11:46:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28d6daed4f119940ace31e523b3b272d3d153d04'/>
<id>urn:sha1:28d6daed4f119940ace31e523b3b272d3d153d04</id>
<content type='text'>
The previous config handling relied on global variables, called
git_default_config() even when the key had already been handled by
git_sequencer_config() and did not initialize the diff configuration
variables. Improve this by: i) loading the default values for message
cleanup and gpg signing of commits into struct replay_opts;
ii) restructuring the code to return immediately once a key is
handled; and iii) calling git_diff_basic_config(). Note that
unfortunately it is not possible to return early if the key is handled
by git_gpg_config() as it does not indicate to the caller if the key
has been handled or not.

The sequencer should probably have been calling
git_diff_basic_config() before as it creates a patch when there are
conflicts. The shell version uses 'diff-tree' to create the patch so
calling git_diff_basic_config() should match that. Although 'git
commit' calls git_diff_ui_config() I don't think the output of
print_commit_summary() is affected by anything that is loaded by that
as print_commit_summary() always turns on rename detection so would
ignore the value in the user's configuration anyway. The other values
loaded by git_diff_ui_config() are about the formatting of patches so
are not relevant to print_commit_summary().

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>rebase -i: learn to abbreviate command names</title>
<updated>2017-12-05T18:20:51Z</updated>
<author>
<name>Liam Beguin</name>
<email>liambeguin@gmail.com</email>
</author>
<published>2017-12-05T17:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8ae6c84da52a210e84b3734bb93c575638236d3'/>
<id>urn:sha1:d8ae6c84da52a210e84b3734bb93c575638236d3</id>
<content type='text'>
`git rebase -i` already know how to interpret single-letter command
names. Teach it to generate the todo list with these same abbreviated
names.

Based-on-patch-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Liam Beguin &lt;liambeguin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
