Re: Trimming 'deadheads' (TREESAME 2nd parent) from revision walks?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux