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

Re: [RFC] Re: git-svn: make git-svn commit-diff able to work without explicit arguments

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jan 2, 2007, 21:26 UTC
Message-ID
<052E1601-5422-48A0-81B3-9A454467CE5F@silverinsanity.com>
In-Reply-To
<20070102211339.GF17898@hades.madism.org>
Show 12 quoted lines
>   The reason is simple, I often use git commit as :wq in my editor,  
> and
> sometimes think that in a A--B--C--D and in fact, I'd prefer to have:
>
>   {A,C}--B--D. how is it possible to do that in a not too cumbersome
> way? because that would make sens to work in some scratch branch, and
> then reorganize patches in a saner better way in the master branch.
>
>   But I fail to see how to achieve that without using cumbersome
> export-to-patch then git apply patch and edit logs which is painful  
> and
> not really using git.

The command you seem to be looking for is git-cherry-pick. To combine the two commits, I'd do something like:

$ git cherry-pick A $ git cherry-pick C $ git reset HEAD~2 $ git add <files> $ git commit

And then you could rebase the work branch on top of the new master, which should catch that A and C were already committed with minimal effort. Of course there may be a cleaner way to do it, but this is what I do.

~~ Brian Gernhardt
Previous: Pierre HabouzitNext: Jakub Narebski
Message 6 of 10 in “[RFC] git-svn: make git-svn commit-diff able to work without explicit arguments”
  1. Steve FrécinauxJan 2, 2007
  2. [RFC] Re: git-svn: make git-svn commit-diff able to work without explicit argumentsPierre Habouzit, Jan 2, 2007
  3. Eric WongJan 2, 2007
  4. Junio C HamanoJan 2, 2007
  5. [RFC] Re: git-svn: make git-svn commit-diff able to work without explicit argumentsPierre Habouzit, Jan 2, 2007
  6. Brian GernhardtJan 2, 2007
  7. Jakub NarebskiJan 2, 2007
  8. [RFC] Re: git-svn: make git-svn commit-diff able to work without explicit argumentsPierre Habouzit, Jan 2, 2007
  9. Junio C HamanoJan 2, 2007
  10. Steve FrécinauxJan 2, 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.