git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] user-manual: Talk about tracking third-party snapshots

From
MSMichael Smith <msmith@cbnco.com>
Date
Nov 13, 2007, 21:37 UTC
Message-ID
<Pine.LNX.4.64.0711131617580.4038@juice.ott.cti.com>
In-Reply-To
<7vtznqrlrb.fsf@gitster.siamese.dyndns.org>
On Tue, 13 Nov 2007, Junio C Hamano wrote:
> > +$ git checkout master
> > +$ git merge --strategy=ours \
> > +    -m "Tie old v1.1 into our history by merging with strategy=ours." \
> > +    v1.1
Show 5 quoted lines
> This would work only when your 'master' happens to be at v1.1
> (and identical to it) isn't it?
> 
> People would want to know "But my 'master' is _not_ at v1.1 but
> is _based_ on v1.1.  How would I handle that case?"

That was actually my case - my master was based on v1.1. The command worked for me - I was able to merge in v1.2 from Git afterward - but maybe I just got lucky, so I'd be interested to know the right thing to do.

I think --strategy=ours just leaves the files as is on master and creates a merge commit with two parents: master and v1.1. So anything between v1.1 and v1.2, on the upstream branch, is fair game to be merged next time.

So, say I started with this:
---------------
old snapshot branch: snap-v1.0---snap-v1.1
                       \           \
master:                 o---o---o---o--o-o

new Git upstream: o--o-v1.0-o-o-o-o-o-o-v1.1-o-o-v1.2 ---------------

I could make the merge with --strategy=ours:
---------------
old snapshot branch: snap-v1.0---snap-v1.1
                       \           \
master:                 o---o---o---o--o-o--o
                                           /
new Git upstream: o--o-v1.0-o-o-o-o-o-o-v1.1-o-o-v1.2
---------------
Then I'd free to merge in v1.2:
---------------
master:                 o---o---o---o--o-o--o------o
                                           /      /
new Git upstream: o--o-v1.0-o-o-o-o-o-o-v1.1-o-o-v1.2
---------------
Hmm, looks like a toothbrush. But is it right?
Mike
Previous: Junio C HamanoNext: J. Bruce Fields
Message 10 of 12 in “user-manual: Talk about tracking third-party snapshots”
  1. user-manual: Talk about tracking third-party snapshotsMichael Smith, Nov 13, 2007
  2. Jakub NarebskiNov 13, 2007
  3. Sergei OrganovNov 13, 2007
  4. Jakub NarebskiNov 13, 2007
  5. Jan HudecNov 17, 2007
  6. Jakub NarebskiNov 17, 2007
  7. Jan HudecNov 17, 2007
  8. Jakub NarebskiNov 17, 2007
  9. Junio C HamanoNov 13, 2007
  10. Michael SmithNov 13, 2007
  11. J. Bruce FieldsNov 19, 2007
  12. J. Bruce FieldsNov 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.