<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/sequencer.h, branch v2.19.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.19.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.19.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-11-21T13:57:42Z</updated>
<entry>
<title>Merge branch 'jk/trailer-fixes' into maint</title>
<updated>2018-11-21T13:57:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-21T13:57:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e293824d00c243c6a7afb15324902f693ae751e8'/>
<id>urn:sha1:e293824d00c243c6a7afb15324902f693ae751e8</id>
<content type='text'>
"git interpret-trailers" and its underlying machinery had a buggy
code that attempted to ignore patch text after commit log message,
which triggered in various codepaths that will always get the log
message alone and never get such an input.

* jk/trailer-fixes:
  append_signoff: use size_t for string offsets
  sequencer: ignore "---" divider when parsing trailers
  pretty, ref-filter: format %(trailers) with no_divider option
  interpret-trailers: allow suppressing "---" divider
  interpret-trailers: tighten check for "---" patch boundary
  trailer: pass process_trailer_opts to trailer_info_get()
  trailer: use size_t for iterating trailer list
  trailer: use size_t for string offsets
</content>
</entry>
<entry>
<title>append_signoff: use size_t for string offsets</title>
<updated>2018-08-23T17:08:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-08-23T00:50:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66e83d9b41f7438cb167b9bb54093ebbf0532437'/>
<id>urn:sha1:66e83d9b41f7438cb167b9bb54093ebbf0532437</id>
<content type='text'>
The append_signoff() function takes an "int" to specify the
number of bytes to ignore. Most callers just pass 0, and the
remainder use ignore_non_trailer() to skip over cruft.
That function also returns an int, and uses them internally.

On systems where size_t is larger than an int (i.e., most
64-bit systems), dealing with a ridiculously large commit
message could end up overflowing an int, producing
surprising results (e.g., returning a negative offset, which
would cause us to look outside the original string).

Let's consistently use size_t for these offsets through this
whole stack. As a bonus, this makes the meaning of
"ignore_footer" as an offset (and not a boolean) more clear.
But while we're here, let's also document the interface.

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 missing includes and forward declarations</title>
<updated>2018-08-15T18:52:09Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2018-08-15T17:54:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef3ca95475ce467ae883cc8175ed40e6f7d27800'/>
<id>urn:sha1:ef3ca95475ce467ae883cc8175ed40e6f7d27800</id>
<content type='text'>
I looped over the toplevel header files, creating a temporary two-line C
program for each consisting of
  #include "git-compat-util.h"
  #include $HEADER
This patch is the result of manually fixing errors in compiling those
tiny programs.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
