{"thread":{"id":"19567","subject":"WISH: Extending git commit --amend","startedAt":"2009-05-29T06:48:46Z","lastAt":"2009-05-29T10:39:46Z","messageCount":4,"participants":["Marco Costalba","Eric Raible","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114983","messageId":"e5bfff550905282348gf29aa16o6eec88423bb5ce23@mail.gmail.com","threadId":"19567","inReplyTo":null,"subject":"WISH: Extending git commit --amend","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2009-05-29T06:48:46Z","receivedAt":"2009-05-29T06:48:46Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Form current documentation\n\n--amend\n\n    Used to amend the tip of the current branch. Prepare the tree\nobject you would want to replace the latest commit as usual (this\nincludes the usual -i/-o and explicit paths), and the commit log\neditor is seeded with the commit message from the tip of the current\nbranch. The commit you create replaces the current tip — if it was a\nmerge, it will have the parents of the current tip as parents — so the\ncurrent top commit is discarded.\n\n    It is a rough equivalent for:\n\n            $ git reset --soft HEAD^\n            $ ... do something else to come up with the right tree ...\n            $ git commit -c ORIG_HEAD\n\n    but can be used to amend a merge commit.\n\n\n\n\n\nI find myself wanting to amend not tip of the branch, but an older\ncommit (typically to change log message). As example if I have this\n\n\nD---E---F---G master\n\nAnd I want to amend revision E currently I do\n\n            $ git branch tmp\n            $ git reset E\n            $ git commit --amend\n            $ git rebase tmp master\n            $ git branch -d tmp\n\n\nWould be possible to extend git commit --amend so to automate the\nabove sequence ? Or does perhaps exists a better sequence to change\n(actually simulate the change of) log message of an inner revision?\n\nThanks in advance\nMarco\n"},{"id":"114990","messageId":"loom.20090529T080514-262@post.gmane.org","threadId":"19567","inReplyTo":"e5bfff550905282348gf29aa16o6eec88423bb5ce23@mail.gmail.com","subject":"Re: WISH: Extending git commit --amend","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2009-05-29T08:09:58Z","receivedAt":"2009-05-29T08:09:58Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"Marco Costalba <mcostalba <at> gmail.com> writes:\n\n> [snip]\n> I find myself wanting to amend not tip of the branch, but an older\n> commit (typically to change log message). As example if I have this\n> \n> D---E---F---G master\n> \n> And I want to amend revision E currently I do\n> \n> [snip]\n> \n> Thanks in advance\n> Marco\n> \n\ngit rebase --interactive E^\nThen change the commit for E from 'pick' to 'edit'.\nThen follow the directions.\n\n- Eric\n"},{"id":"114991","messageId":"vpqprds2uu6.fsf@bauges.imag.fr","threadId":"19567","inReplyTo":"e5bfff550905282348gf29aa16o6eec88423bb5ce23@mail.gmail.com","subject":"Re: WISH: Extending git commit --amend","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-05-29T08:10:09Z","receivedAt":"2009-05-29T08:10:09Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Marco Costalba <mcostalba@gmail.com> writes:\n\n> Would be possible to extend git commit --amend so to automate the\n> above sequence ? Or does perhaps exists a better sequence to change\n> (actually simulate the change of) log message of an inner revision?\n\ngit rebase -i E^\n\nThen, change a \"pick\" with a \"edit\" wherever you want.\n\n(Perhaps the doc of commit --amend could say \"to amend a previous\ncommit, you may want to look at the 'edit' command of 'git rebase\n-i'\"?)\n\n-- \nMatthieu\n"},{"id":"115002","messageId":"e5bfff550905290339t6b1d94b6j7f0aa9508ab14a26@mail.gmail.com","threadId":"19567","inReplyTo":"vpqprds2uu6.fsf@bauges.imag.fr","subject":"Re: WISH: Extending git commit --amend","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2009-05-29T10:39:46Z","receivedAt":"2009-05-29T10:39:46Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Thanks !\n"}]}