From: Avery Pennarun Date: Wed, 03 Feb 2010 18:19:41 GMT Subject: Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes written Message-ID: <32541b131002031019l42d3903cs58303a546f019898@mail.gmail.com> In-Reply-To: <20100203093150.GA23956@coredump.intra.peff.net> On Wed, Feb 3, 2010 at 4:31 AM, Jeff King wrote: > On Wed, Feb 03, 2010 at 01:15:35AM -0500, Larry D'Anna wrote: >> * Avery Pennarun (apenwarr@gmail.com) [100202 18:41]: >> > You can however add *new* stuff.  That's why I suggested adding an >> > option.  You could even make it a config option so you only have to >> > set it once (just like setting your preferred editor). >> >> Or, he can set his $EDITOR to a script that checks the mtime. Nice. > Do note, though, that there is a subtle race condition in using the > mtime. If you make a change and save within a second of the editor > starting, it will be ignored. To be thorough, you would probably want to > check the size and inode, as well. Or just the file contents. Avery