All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Philip Oakley <philipoakley@iee.email>, Git List <git@vger.kernel.org>
Subject: Re: Trimming 'deadheads' (TREESAME 2nd parent) from revision walks?
Date: Mon, 20 Sep 2021 01:44:23 +0200	[thread overview]
Message-ID: <87k0jcb01k.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <YUeImAqA0SZAdA2R@coredump.intra.peff.net>


On Sun, Sep 19 2021, Jeff King wrote:

> On Sat, Sep 18, 2021 at 03:18:47PM +0100, Philip Oakley wrote:
>
>> Is there a method within `git rev-list` to trim side branch merges where
>> the merge's tree is identical to the first parent's commit-tree?
>> [...]
>> From my reading of the `rev-list` manual this is similar to the <paths>
>> TREESAME capability, but without specifying any paths (maybe just `.` ?).
>
> Yes, I'd just do "git log ." for this. I don't think there's another way
> to trigger simplification. In try_to_simplify_commit(), we bail early
> unless revs->prune is set, and that is set only by the presence of
> pathspecs or by --simplify-by-decoration.
>
>> * Is there a proper term for the treesame condition of the commit-tree
>> (as recorded in the commit object)?
>
> In a one-parent commit, I'd just call it an empty commit. For a merge,
> it is really I'd probably call it an "ours" merge, since one obvious way
> to get there is with "git merge -s ours" (of course you can also just
> resolve all conflicts in favor of one parent). I don't know of another
> name (besides treesame, of course, but that generally implies a
> particular scope of interest given by a pathspec).

Isn't it a "theirs" merge, not "ours"? Per the description Philip has:

    In the Git-for Windows repository, the previous releases are
    'deadheaded' by merging with the upstream git, and simply taking the
    upstream's tree unconditionally[...]

I.e. if you're taking your tree unconditionally it's -s ours, but -s
theirs for theirs. Except of course for the small matter of us not
having a "-s theirs" yet.

I had a WIP patch a while ago for a "-s theirs -X N", for what sounds
like a similar use-case:
https://lore.kernel.org/git/87sh7sdtc1.fsf@evledraar.gmail.com/

  reply	other threads:[~2021-09-19 23:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 14:18 Trimming 'deadheads' (TREESAME 2nd parent) from revision walks? Philip Oakley
2021-09-19 18:59 ` Jeff King
2021-09-19 23:44   ` Ævar Arnfjörð Bjarmason [this message]
2021-09-20 11:40     ` Philip Oakley
2021-09-20 20:50       ` Jeff King
2021-09-21 13:36         ` Philip Oakley
2021-09-21 18:24           ` Philip Oakley
2021-10-05 10:53 ` Johannes Schindelin
2021-10-06 14:03   ` Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0jcb01k.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.email \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.