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

Re: sending changesets from the middle of a git tree

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 14, 2005, 05:03 UTC
Message-ID
<Pine.LNX.4.58.0508132155100.3553@g5.osdl.org>
In-Reply-To
<42FEBC16.9050309@austin.rr.com>
On Sat, 13 Aug 2005, Steve French wrote:
> 
> 1) There is no way to send a particular changeset from the "middle" of a 
> set from one tree to another, without exporting it as a patch or 
> rebuilding a new git tree.
Correct.
> If I export those two changesets as patches, and send them on.
> presumably I lose the changset comments etc.

Well, you can export them with "git send-email" and you won't be losing any comments.

Alternatively, use "git cherry", which helps re-order the commits in your tree. They'll be _new_ commits, but they'll have the contents moved over. Junio, maybe you want to talk about how you move patches from your "pu" branch to the real branches.

> and then when the upstream tree is merged back, it might look a little
> odd in the changeset history.

Well, you'll end up having the same change twice. It happens. Or if you just redo your tree as a separate branch, you can reorder things so that you don't have them twice at all.

> 2) There is no way to update the comment field of a changeset after it 
> goes in (e.g. to add a bugzilla bug number for a bug that was opened 
> just after the fix went in).

That's correct. Same things apply: you can move a patch over, and create a new one with a modified comment, but basically the _old_ commit will be immutable.

The good news is that it means that nobody else can change what you said or did either.

> 3) There is no way to do a test commit of an individual changeset 
> against a specified tree (to make sure it would still merge cleanly, 
> automatically).

Oh, sure, that's certainly very possible, and the git cherry stuff even helps you do it. Or use "git-apply --check" to just see if a patch applies and do your own scripts.

		Linus
Previous: Ryan AndersonNext: Linus Torvalds
Message 4 of 12 in “sending changesets from the middle of a git tree”
  1. Steve FrenchAug 14, 2005
  2. Ryan AndersonAug 14, 2005
  3. Ryan AndersonAug 15, 2005
  4. Linus TorvaldsAug 14, 2005
  5. Linus TorvaldsAug 14, 2005
  6. Junio C HamanoAug 14, 2005
  7. Petr BaudisAug 14, 2005
  8. Junio C HamanoAug 15, 2005
  9. Catalin MarinasAug 15, 2005
  10. Wolfgang DenkAug 17, 2005
  11. Junio C HamanoAug 17, 2005
  12. Catalin MarinasAug 15, 2005

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.