{"thread":{"id":"6602","subject":"Modify/edit old commit messages","startedAt":"2007-02-01T11:49:09Z","lastAt":"2007-02-01T23:24:53Z","messageCount":5,"participants":["Rodolfo Giometti","Johannes Schindelin","Linus Torvalds","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"33226","messageId":"20070201114909.GV8705@enneenne.com","threadId":"6602","inReplyTo":null,"subject":"Modify/edit old commit messages","fromName":"Rodolfo Giometti","fromEmail":"giometti@enneenne.com","sentAt":"2007-02-01T11:49:09Z","receivedAt":"2007-02-01T11:49:09Z","isPatch":false,"sender":{"key":"giometti@enneenne.com","avatar":null},"body":"Hello,\n\nI'm puzzled... how can I modify or edit old commit messages? :)\n\nThanks in advance,\n\nRodolfo\n\n-- \n\nGNU/Linux Solutions                  e-mail:    giometti@enneenne.com\nLinux Device Driver                             giometti@gnudd.com\nEmbedded Systems                     \t\tgiometti@linux.it\nUNIX programming                     phone:     +39 349 2432127\n"},{"id":"33227","messageId":"Pine.LNX.4.63.0702011326130.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6602","inReplyTo":"20070201114909.GV8705@enneenne.com","subject":"Re: Modify/edit old commit messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-01T12:28:44Z","receivedAt":"2007-02-01T12:28:44Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 1 Feb 2007, Rodolfo Giometti wrote:\n\n> I'm puzzled... how can I modify or edit old commit messages? :)\n\nShort answer: you can't.\n\nSlightly longer answer: since the object name is calculated from data \nincluding the commit message, there is no way you can change it.\n\nHowever, you can start from a certain commit in history, and _recommit_ a \ncommit. There, you can edit the message and rebase the other commits on \ntop of it. NOTE: the resulting commit is _not_ easily mergeable for people \nwho track your branch.\n\nHth,\nDscho\n"},{"id":"33251","messageId":"Pine.LNX.4.64.0702010829560.3632@woody.linux-foundation.org","threadId":"6602","inReplyTo":"Pine.LNX.4.63.0702011326130.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Modify/edit old commit messages","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-01T16:41:32Z","receivedAt":"2007-02-01T16:41:32Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 1 Feb 2007, Johannes Schindelin wrote:\n> \n> On Thu, 1 Feb 2007, Rodolfo Giometti wrote:\n> > \n> > I'm puzzled... how can I modify or edit old commit messages? :)\n> \n> Short answer: you can't.\n\nSide note, just out of historical interest: in BK you could.\n\nAnd if you're used to it (like I was) it was really quite practical. I \nwould apply a patch-bomb from Andrew, notice something was wrong, and just \nedit it before pushing it out.\n\nI could have done the same with git. It would have been easy enough to \nmake just the commit message not be part of the name, and still guarantee \nthat the history was untouched, and allow the \"fix up comments later\" \nthing.\n\nBut I didn't.\n\nPart of it is purely \"internal consistency\". Git is simply a _cleaner_ \nsystem thanks to everything being SHA1-protected, and all objects being \ntreated the same, regardless of object type. Yeah, there are four \ndifferent kinds of objects, and they are all really different, and they \ncan't be used in the same way, but at the same time, even if their \nencoding might be different on disk, *conceptually* they all work exactly \nthe same.\n\nBut internal consistency isn't really an excuse for being inflexible, and \nclearly it would be very flexible if we could just fix up mistakes after \nthey happen. So that's not a really strong argument.\n\nThe *real* reason git doesn't allow you to change the commit message ends \nup being very simple: that way, you can trust the messages. If you allowed \npeople to change them afterwards, the messages are inherently not very \ntrustworthy.\n\nIn BK, for example, if you edited the commit message after already pushing \nit out, it would *work*, but the stuff you pushed out would obviously not \nbe changed, so different repositories would literally have different \ncommit messages. I did it anyway a few times when some really irritating \ntypo just made me say \"I can't stand reading that typo over and over \nagain, I'll fix it in my tree and screw everybody else\".\n\nBut it's also very important because nobody *else* can mess with your \nhistory without it being obvious to everybody who has ever seen the \npristine one, and nobody can change what you said later. Yeah, there's a \nfew embarrassing typo's in the kernel history. We'll never be able to live \ndown the fact that spelling and grammar is the dificultest for us. And we \nhave some bugs where people have corrupt email addresses etc.\n\nAnd I'll take guaranteed history over typos any day. \n\n\t\t\tLinus\n"},{"id":"33255","messageId":"Pine.LNX.4.63.0702011816180.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6602","inReplyTo":"Pine.LNX.4.63.0702011326130.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Modify/edit old commit messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-01T17:17:32Z","receivedAt":"2007-02-01T17:17:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 1 Feb 2007, Johannes Schindelin wrote:\n\n> On Thu, 1 Feb 2007, Rodolfo Giometti wrote:\n> \n> > I'm puzzled... how can I modify or edit old commit messages? :)\n> \n> Short answer: you can't.\n\nAmendment:\n\nYou can easily, but only the latest commit, with \"git commit --amend\". Be \nwarned though, the same as with rebase applies here: if you pushed this \ncommit somewhere else, or if users fetched that branch from you (including \nthe not-yet-edited commit), they _will_ have problems fetching and/or \nmerging.\n\nCiao,\nDscho\n"},{"id":"33308","messageId":"eptspk$cak$2@sea.gmane.org","threadId":"6602","inReplyTo":"20070201114909.GV8705@enneenne.com","subject":"Re: Modify/edit old commit messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-01T23:24:53Z","receivedAt":"2007-02-01T23:24:53Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: git@vger.kernel.org]\n\nRodolfo Giometti wrote:\n\n> Hello,\n> \n> I'm puzzled... how can I modify or edit old commit messages? :)\n\nhttp://git.or.cz/gitwiki/GitTips\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}