Merged repo for protocol headers? Why are they split?

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 29 22:28:56 UTC 2017


On Wed, Nov 29, 2017 at 03:44:53PM +0100, Daniel Martin wrote:
> On 29 November 2017 at 15:01, Daniel Stone <daniel at fooishbar.org> wrote:
> > Hi,
> >
> > On 28 November 2017 at 12:38, Daniel Martin <consume.noise at gmail.com> wrote:
> >> On 27 November 2017 at 23:18, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> >>> have you looked at subtree merges? Keeps the repo history for each merged
> >>> repository and the one from the top-level repository. And it forces you to
> >>> merge into a directory anyway, so that's a win right there.
> >>
> >> Oh? No, didn't knew that before. But, tested it:
> >> $ git remote add -f randrproto
> >> git://anongit.freedesktop.org/xorg/proto/randrproto
> >> $ git subtree add --prefix=randrproto/ randrproto master
> >>
> >> The history in the toplevel looks good. But, log -p shows the original
> >> paths in the commits. Okay, it doesn't rewrite history. I can deal
> >> with that.
> >> Though,
> >> $ git log (--graph) randrproto/randr.h
> >> just shows one commit from the subtree add.
> >
> > git log --follow -- randrproto/randr.h
> 
> Nope, doesn't work, even if I'm in randrproto/ and omit the path.
> But, it works if I'm in the toplevel and omit the path. O.o?

it is a bit strange. We used the subtree merge to merge ratbagd into
libratbag and now I'm getting:

git log ratbagd/
  is the history up until the merge
cd ratbagd && git log . 
 is the history since the merge

Adding --follow seems to have no effect on either

> Imho git-subtree is not for merging repos. It exists to source some
> 3rd party code into the tree, be able to update it easily and
> preferably squash its history.

The history is there, it just seems that git log seems confused as to what
to do, apparently it can't correctly follow the files past the merge.

Cheers,
   Peter


More information about the xorg-devel mailing list