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

Re: [PATCH] git-svn: remove --first-parent, add --upstream

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Sep 7, 2007, 08:43 UTC
Message-ID
<20070907084352.GD4538@xp.machine.xx>
In-Reply-To
<8c5c35580709061723m7e01c9d4p1b1936dc1d590459@mail.gmail.com>
On Fri, Sep 07, 2007 at 02:23:58AM +0200, Lars Hjemli wrote:
Show 14 quoted lines
> On 9/7/07, Peter Baumann <waste.manager@gmx.de> wrote:
> > Wouldn't it be much more pleasant to say something like
> >
> >         git-svn dcommit --on the_branch
> >
> > whereas 'the_branch' is the name of the upstream branch as specified
> > in the fetch/branch section in the git config?
> 
> Well, git-svn extracts the svn url, revision and repo uuid from the
> commit message, while your proposal only specifies the url. But I'm
> still not certain that there is a need for --upstream or anything
> similar if git-svn always uses 'git log --first-parent' (see
> http://article.gmane.org/gmane.comp.version-control.git/57951).
> 
First parent is a heuristic (and a good one, me thinks).
If you did something like this:
(1) Start state:
       a-b-c-d-e    trunk	(both trunk and branch1 are imported
          \			 from SVN)
	   \-x-y    branch1
(2) Hm. My Branch 'branch1' should be ready to be merged to 'trunk', so
   lets do it (not yet dcommited)
       a-b-c-d-e- m trunk
          \	 /
	   \ -x-y   branch1
(3) ARGH. I just discovered a serious bug in 'branch1' and can't just merge
   it into 'trunk', yet. But the merge was painfull enough so I don't want to
   redo it again, so lets reset 'trunk' to its state before the merge and
   'branch1' to the merge commit, before fixing the bug in 'branch1'.
       a-b-c-d-e    trunk
          \	 \
	   \ -x-y m branch1

Notice that this DAG is identical to the one in (2), but just the branch labels stick to different commits. And if you now want to commit the merge 'm' to 'branch1' before fixing the bug you are screwed, because --first-parent will give you 'e' instead of 'y'.

Yes, I know that this example isn't something happening every day, but at least it shows that --first-parent could *only* be a heuristic and not something you would rely 100% on. And if you imagine several people who are sharing their git commits for codereview with pulling/pushing, it isn't obvious what branch got merged into the other, because it is possible that the other person did the merge.

Don't get me wrong, --first-parent *is* an improvement over the current behaviour, but I think it is simply not the *best* we can do.

-Peter
Previous: Lars HjemliNext: Lars Hjemli
Message 14 of 22 in “git-svn: add support for --first-parent”
  1. git-svn: add support for --first-parentLars Hjemli, Sep 5, 2007
  2. Eric WongSep 5, 2007
  3. Lars HjemliSep 6, 2007
  4. Eric WongSep 6, 2007
  5. David KastrupSep 6, 2007
  6. Lars HjemliSep 6, 2007
  7. git-svn: remove --first-parent, add --upstreamLars Hjemli, Sep 6, 2007
  8. Steven GrimmSep 6, 2007
  9. Eric WongSep 6, 2007
  10. Eric WongSep 6, 2007
  11. Lars HjemliSep 6, 2007
  12. Peter BaumannSep 6, 2007
  13. Lars HjemliSep 7, 2007
  14. Peter BaumannSep 7, 2007
  15. Lars HjemliSep 7, 2007
  16. Peter BaumannSep 7, 2007
  17. Configure mutt to be used in git and lkml mailing lists (was: Re: [PATCH] git-svn: remove --first-parent, add --upstream)Fernando J. Pereda, Sep 7, 2007
  18. Eric WongSep 7, 2007
  19. Lars HjemliSep 15, 2007
  20. Peter BaumannSep 15, 2007
  21. Lars HjemliSep 15, 2007
  22. Peter BaumannSep 15, 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.