{"thread":{"id":"37818","subject":"Editing git changelog automatically","startedAt":"2014-10-27T05:27:17Z","lastAt":"2014-10-30T06:14:05Z","messageCount":6,"participants":["Cong Wang","Dennis Kaarsemaker","Matthieu Moy","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251088","messageId":"CAM_iQpWNQbv_GTT+H5KNCqqRS3qWfBuBge4+ZTAS_WiaREku4w@mail.gmail.com","threadId":"37818","inReplyTo":null,"subject":"Editing git changelog automatically","fromName":"Cong Wang","fromEmail":"xiyou.wangcong@gmail.com","sentAt":"2014-10-27T05:27:17Z","receivedAt":"2014-10-27T05:27:17Z","isPatch":false,"sender":{"key":"xiyou.wangcong@gmail.com","avatar":null},"body":"Hello, git experts\n\n\nSorry if this is a question already answered, but google search didn't\ngive me anything useful.\n\nMy question is how to edit dozens of git commit changelogs automatically?\n\nLet's say I want to fix a stupid typo in all of these commits, as\nsimply as s/foo/bar/. Usually I use`git rebase -i` and `git commit\n--amend`, but both of them are interactive, apparently I don't want to\nedit them one by one. :)\n\nI know I can change $EDITOR to something like `sed -e 's/foo/bar/'`,\nbut this seems pretty ugly. Is there a clean way to do that?\n\nThanks!\n"},{"id":"251089","messageId":"1414389944.7883.2.camel@spirit","threadId":"37818","inReplyTo":"CAM_iQpWNQbv_GTT+H5KNCqqRS3qWfBuBge4+ZTAS_WiaREku4w@mail.gmail.com","subject":"Re: Editing git changelog automatically","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2014-10-27T06:05:44Z","receivedAt":"2014-10-27T06:05:44Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On zo, 2014-10-26 at 22:27 -0700, Cong Wang wrote:\n> \n> My question is how to edit dozens of git commit changelogs\n> automatically?\n\nYou can use git filter-branch in --msg-filter mode.\n-- \nDennis Kaarsemaker\nwww.kaarsemaker.net\n"},{"id":"251094","messageId":"vpq38a9lxnu.fsf@anie.imag.fr","threadId":"37818","inReplyTo":"1414389944.7883.2.camel@spirit","subject":"Re: Editing git changelog automatically","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-10-27T08:33:25Z","receivedAt":"2014-10-27T08:33:25Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:\n\n> On zo, 2014-10-26 at 22:27 -0700, Cong Wang wrote:\n>> \n>> My question is how to edit dozens of git commit changelogs\n>> automatically?\n>\n> You can use git filter-branch in --msg-filter mode.\n\nNote that in any case, you'll rewrite the history hence change commit\nidentifiers. If the history is already published, it's probably better\nto live with the typo than to try to fix it now.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"251127","messageId":"87zjch9w5w.fsf@igel.home","threadId":"37818","inReplyTo":"CAM_iQpWNQbv_GTT+H5KNCqqRS3qWfBuBge4+ZTAS_WiaREku4w@mail.gmail.com","subject":"Re: Editing git changelog automatically","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-10-27T18:58:51Z","receivedAt":"2014-10-27T18:58:51Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Cong Wang <xiyou.wangcong@gmail.com> writes:\n\n> Let's say I want to fix a stupid typo in all of these commits, as\n> simply as s/foo/bar/. Usually I use`git rebase -i` and `git commit\n> --amend`, but both of them are interactive, apparently I don't want to\n> edit them one by one. :)\n\nBoth can be scripted, though.\n\n> I know I can change $EDITOR to something like `sed -e 's/foo/bar/'`,\n> but this seems pretty ugly. Is there a clean way to do that?\n\nI don't see the ugliness.  There is no requirement that $EDITOR is\ninteractive.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"251205","messageId":"CAM_iQpWAHtTOXsiGPbQOMs4x9VBMaFOXMUYaSZi4V1aFrvTgUg@mail.gmail.com","threadId":"37818","inReplyTo":"1414389944.7883.2.camel@spirit","subject":"Re: Editing git changelog automatically","fromName":"Cong Wang","fromEmail":"xiyou.wangcong@gmail.com","sentAt":"2014-10-30T06:13:16Z","receivedAt":"2014-10-30T06:13:16Z","isPatch":false,"sender":{"key":"xiyou.wangcong@gmail.com","avatar":null},"body":"On Sun, Oct 26, 2014 at 11:05 PM, Dennis Kaarsemaker\n<dennis@kaarsemaker.net> wrote:\n> On zo, 2014-10-26 at 22:27 -0700, Cong Wang wrote:\n>>\n>> My question is how to edit dozens of git commit changelogs\n>> automatically?\n>\n> You can use git filter-branch in --msg-filter mode.\n\nThis is exactly what I am looking for. Good to know this git command.\n\nThanks!\n"},{"id":"251206","messageId":"CAM_iQpW-_src0W2-WkDRTMobua6UAQncvPqcxfqi6T82TdC7eA@mail.gmail.com","threadId":"37818","inReplyTo":"vpq38a9lxnu.fsf@anie.imag.fr","subject":"Re: Editing git changelog automatically","fromName":"Cong Wang","fromEmail":"xiyou.wangcong@gmail.com","sentAt":"2014-10-30T06:14:05Z","receivedAt":"2014-10-30T06:14:05Z","isPatch":false,"sender":{"key":"xiyou.wangcong@gmail.com","avatar":null},"body":"On Mon, Oct 27, 2014 at 1:33 AM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:\n>\n>> On zo, 2014-10-26 at 22:27 -0700, Cong Wang wrote:\n>>>\n>>> My question is how to edit dozens of git commit changelogs\n>>> automatically?\n>>\n>> You can use git filter-branch in --msg-filter mode.\n>\n> Note that in any case, you'll rewrite the history hence change commit\n> identifiers. If the history is already published, it's probably better\n> to live with the typo than to try to fix it now.\n\nI am aware of that, it is my local branch, so no worry.\n\nThanks.\n"}]}