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

Re: git bug

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 5, 2024, 06:47 UTC
Message-ID
<ZcCEbaId0HL4Briz@tanuki>
In-Reply-To
<CAPvDF0P7_s-iy_V7FNSHtXXc9v5E3Fm=AdgduDDsd0rM-zNg-g@mail.gmail.com>
On Mon, Feb 05, 2024 at 12:42:03AM +0100, moti sd wrote:
Show 33 quoted lines
> Dear Git Team,
> 
> I am writing to report a potential bug encountered while using the "git
> stash" command. The issue was observed during a troubleshooting. Please
> find the details below:
> 
> *Problem Description:*
> 
> The "git stash" command is not providing any feedback or indication of
> execution, even though modifications are present and the stash operation is
> attempted.
> *Steps to Reproduce:*
> 
> Make modifications to a file.
> Execute "git stash" to stash changes.
> *Expected Behavior:*
> 
> The "git stash" command should provide feedback on the stash operation,
> confirming whether it was successful or if there were any errors.
> *Additional Information:*
> The issue was initially observed when executing "git commit -a --amend" and
> pressing Ctrl+Z to exit. Subsequent attempts to use "git stash" resulted in
> an error.
> Testing with a provided ZIP file containing a problematic repository
> confirmed the issue's recurrence.
> *Investigation and Findings:*
> 
> Upon investigation, it was discovered that the use of Ctrl+Z after "git
> commit -a --amend" might be the root cause.
> Deleting a lock file left behind by the incomplete git command resolved the
> issue, indicating a potential bug in how "git stash" handles incomplete
> commands.
> *Recommendation:*

This is indeed it. The problem is that the index will be locked while git-commit(1) is active, and thus git-stash(1) cannot write to it at the same time. So this is working as designed. What's not though is the fact that we don't print an error message.

I'll send a patch in reply to this message to fix this bug. Thanks for your report!

Patrick
Previous: moti sdNext: Patrick Steinhardt
Message 2 of 8 in “git bug”
  1. moti sdFeb 4, 2024
  2. Patrick SteinhardtFeb 5, 2024
  3. builtin/stash: report failure to write to indexPatrick Steinhardt, Feb 5, 2024
  4. Rubén JustoFeb 5, 2024
  5. Patrick SteinhardtFeb 6, 2024
  6. Junio C HamanoFeb 6, 2024
  7. Patrick SteinhardtFeb 6, 2024
  8. builtin/stash: report failure to write to indexPatrick Steinhardt, Feb 6, 2024

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.