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

Re: [RFC] git commit --branch

From
Shawn Pearce <spearce@spearce.org>
Date
May 29, 2006, 21:35 UTC
Message-ID
<20060529213543.GA29054@spearce.org>
In-Reply-To
<20060529212249.GF14325@admingilde.org>
Martin Waitz <tali@admingilde.org> wrote:
Show 12 quoted lines
> On Mon, May 29, 2006 at 04:41:58PM -0400, Shawn Pearce wrote:
> > Interesting.  I have been kicking around doing the very same
> > thing myself but just have not gotten around to it.  Its complex,
> > especially if the current HEAD isn't strictly the merge commit
> > between the topic branch and the previous value of HEAD; in that
> > case you may want to replay the commits which are on HEAD but are
> > post the merge commit using a form of git-rebase.  Except you would
> > want to preserve any merges which happened by remerging them rather
> > than simply exporting a massive patch and reapplying it.
> 
> Perhaps something like merge-recursive makes sense, except that
> I have no clue how it works ;-)

merge-recursive isn't the right tool here. Its job is to perform a 3 way merge "quickly" by dealing with file adds, deletes, renames and patch application when a file was modified by both parents.

Now that diff+apply is probably faster than a 3 way merge in
read-tree precisely because it doesn't need to run merge-recursive
I'm starting to look at how we can use apply to do partial
application of a patch and use RCS' diff3 or just drop a reject
file out when a hunk doesn't apply cleanly.
 
> But then an operation as important as commit has to be bullet-proof
> and I don't like to do anything complex in there.

I agree. But I'd like to see some sort of functionality to automatically handle some common topic branche cases in commit. Of course I consider the current commit tool to already be too complex (like being able to pull the commit message from any random commit).

-- 
Shawn.
Previous: Martin WaitzNext: Martin Waitz
Message 4 of 15 in “[RFC] git commit --branch”
  1. Martin WaitzMay 29, 2006
  2. Shawn PearceMay 29, 2006
  3. Martin WaitzMay 29, 2006
  4. Shawn PearceMay 29, 2006
  5. Martin WaitzMay 29, 2006
  6. Shawn PearceMay 29, 2006
  7. Johannes SchindelinMay 29, 2006
  8. Jakub NarebskiMay 29, 2006
  9. Martin WaitzMay 29, 2006
  10. Johannes SchindelinMay 29, 2006
  11. Junio C HamanoMay 30, 2006
  12. Martin WaitzMay 30, 2006
  13. Junio C HamanoMay 30, 2006
  14. Martin WaitzMay 31, 2006
  15. Jon LoeligerJun 5, 2006

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.