Re: path-restricted log vs. subtree merges

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

 



On Sat, Mar 15, 2025 at 03:45:01PM +0100, Oswald Buddenhagen wrote:

> in my quest to prepare for hacking git-gui, i ran
> 
>   cd .../git/git-gui
>   git log .
> 
> the result is ... unhelpful. apart from a few commits that were done
> directly in the git repo, there are only merges. notably, there is no
> trace of the commits that are being merged (and the way gitk presents
> this partial log is even more unhelpful).
> 
> i'm speculating that this is the result of git log not handling the
> subtree merges in any way, with somewhat predictable consequences.

Yes, the merged-in paths and the paths in the original commits are
different. So the merge will update path "git-gui/git-gui.sh", etc, but
the individual commits are touching "git-gui.sh" at the root of the tree
(in the git-gui repository).

Leaving aside for a moment how --follow and other tooling could help,
the workaround in this case is:

  git log -- git-gui/ git-gui.sh lib/

You need to ask for the paths you care about at the root-level (since
that's what the individual commits from the git-gui repo will have). But
you also need to include git-gui/; otherwise history simplification will
not go down the side branches from the git-gui repo (you can also use
--full-history, but that would include a lot of irrelevant stuff). And
you need to use "--" before the paths, since the rev/path dwim logic
will only treat an argument as a path if it is present in the working
tree (which the latter two paths are not).

-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