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

Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes written

From
ESEugene Sajine <euguess@gmail.com>
Date
Feb 3, 2010, 18:49 UTC
Message-ID
<76c5b8581002031049t5558a700qe2e05bb70d175305@mail.gmail.com>
In-Reply-To
<1088CD70-9D6E-4B97-9A46-BDDE1535B703@wincent.com>
On Wed, Feb 3, 2010 at 1:21 PM, Wincent Colaiuta <win@wincent.com> wrote:
Show 73 quoted lines
> El 03/02/2010, a las 16:45, Eugene Sajine escribió:
>
>> On Wed, Feb 3, 2010 at 2:31 AM, Matthieu Moy
>> <Matthieu.Moy@grenoble-inp.fr> wrote:
>>>
>>> Eugene Sajine <euguess@gmail.com> writes:
>>>
>>>> Thank you, but I'm not wrong, as i described the exact same thing
>>>> somewhere in my second or third message, without even knowing the
>>>> implementation details. I understand the reason WHY it is like it is,
>>>> i just don't like it as it is inconsistent and IMHO incorrect.
>>>
>>> Just try:
>>>
>>> Create a file.
>>> 1) Launch emacs, save and quit.
>>> 2) Launch emacs, don't save, and quit.
>>>
>>> From outside, it's EXACTLY the same thing. In the first case, emacs
>>> will just tell you "no change need to be saved" and quit, in the
>>> second, it'll quit. Try deleting the file in the meantime, it won't
>>> change the behavior.
>>>
>>> Now, what would you do about this? Ignore Emacs and force people to
>>> use vi?
>>>
>>> People have been spending a whole thread to explain you that it's not
>>> going to work. I think it'll either be time to acknowledge that, or to
>>> learn C and write a patch. Or perhaps try to write it in Java to
>>> understand why it doesn't work.
>>>
>>> --
>>> Matthieu Moy
>>> http://www-verimag.imag.fr/~moy/
>>>
>>
>> Tell me you're not serious, please;) I'm working with computers for
>> more than 20 years and I do understand how editors are opening files.
>> If you are serious though...:
>>
>> Please, do not assume i don't understand that file opened in editor
>> and saved with no changes will be the same as not saved.
>>
>> Please, do not assume i don't understand that current implementation
>> does not allow to correctly abort by simply quiting the editor,
>> because it uses the file content only to verify if it can proceed.
>>
>>
>> I will stop trying to explain the problem here, but the solution, that
>> i think should work:
>>
>> The solution should be as Avery proposed - to monitor file
>> modification timestamp as well as the content.
>> Timestamp should be remembered by git when editor is fired up and then
>> checked when you're exiting the editor. If it is the same - it means
>> that user canceled the whole operation by not confirming the file
>> content by save. If the timestamp is bigger than the saved one and the
>> message is not empty - we can proceed. Something like that.
>>
>> And finally:
>>
>> I DO highly appreciate everybody's time spent on every discussion and
>> particularly this one. I ask you to excuse me if i was failing to
>> properly express my thoughts or if i was too emotional at times.
>
> Perhaps you could invest a little time actually reading what people have
> written. Your proposal won't work because in the case where the user wants
> to keep the commit message without any modifications many editors won't
> touch the file even if people explicitly save it.
>
> Wincent
>
>
Thank you for clarifying that.

OK. I admit I got confused with the fact that some editors (vi, kwrite, gedit - i just tested them to be 100% sure) do allow you to hit save right after the file was opened and the timestamp will be changed, while emacs or open office writer or some others do not, if no changes has been made. Therefore there is no way to actually change the timestamp on the file from editors like emacs without actually changing something.

I'm very sorry for confusion, so, please, accept my apologies for being stubborn.

I hope it is clear that my only intention is to try to make git better and provide useful feedback and I'm sorry i didn't succeed this time.

Thanks, Eugene

Previous: Wincent ColaiutaNext: Avery Pennarun
Message 35 of 45 in “[BUG] - "git commit --amend" commits, when exiting the editor with no changes written”
  1. Eugene SajineFeb 2, 2010
  2. Jacob HelwigFeb 2, 2010
  3. Avery PennarunFeb 2, 2010
  4. Eugene SajineFeb 2, 2010
  5. Wincent ColaiutaFeb 2, 2010
  6. Eugene SajineFeb 2, 2010
  7. Erik Faye-LundFeb 2, 2010
  8. Wincent ColaiutaFeb 2, 2010
  9. Eugene SajineFeb 2, 2010
  10. Avery PennarunFeb 2, 2010
  11. Eugene SajineFeb 2, 2010
  12. Johannes SchindelinFeb 2, 2010
  13. Eugene SajineFeb 2, 2010
  14. Avery PennarunFeb 2, 2010
  15. Larry D'AnnaFeb 3, 2010
  16. Jeff KingFeb 3, 2010
  17. Jeff KingFeb 3, 2010
  18. Avery PennarunFeb 3, 2010
  19. Johannes SchindelinFeb 2, 2010
  20. Eugene SajineFeb 2, 2010
  21. Erik Faye-LundFeb 2, 2010
  22. Eugene SajineFeb 2, 2010
  23. Erik Faye-LundFeb 3, 2010
  24. Eugene SajineFeb 3, 2010
  25. SZEDER GáborFeb 3, 2010
  26. Matthieu MoyFeb 3, 2010
  27. aborting rebase -i right at the start, was Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes writtenJohannes Schindelin, Feb 3, 2010
  28. SZEDER GáborFeb 3, 2010
  29. Eugene SajineFeb 3, 2010
  30. Matthieu MoyFeb 3, 2010
  31. Eugene SajineFeb 3, 2010
  32. Jonathan NiederFeb 3, 2010
  33. Jonathan NiederFeb 3, 2010
  34. Wincent ColaiutaFeb 3, 2010
  35. Eugene SajineFeb 3, 2010
  36. Avery PennarunFeb 3, 2010
  37. Eugene SajineFeb 3, 2010
  38. Avery PennarunFeb 3, 2010
  39. Matthieu MoyFeb 3, 2010
  40. Johannes SchindelinFeb 2, 2010
  41. Eugene SajineFeb 3, 2010
  42. Johannes SchindelinFeb 3, 2010
  43. Paolo BonziniFeb 3, 2010
  44. Junio C HamanoFeb 2, 2010
  45. Avery PennarunFeb 2, 2010

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.