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

Re: Feature Request: Show status of the stash in git status command

From
Jeff King <peff@peff.net>
Date
Jun 10, 2017, 08:25 UTC
Message-ID
<20170610082534.6437ifexzly4oqg6@sigill.intra.peff.net>
In-Reply-To
<CA+B9myHRahTd+FDgzK5AhXW+hq_Y_czMX9X6MXYBcr9WSPeiDw@mail.gmail.com>
On Wed, Jun 07, 2017 at 06:46:18PM -0400, Houston Fortney wrote:
> I sometimes forget about something that I stashed. It would be nice if
> the git status command would just say "There are x entries in the
> stash." It can say nothing if there is nothing stashed so it is
> usually not adding clutter.
I think the clutter issue would depend on your workflow around stash.

Some people carry tidbits in their stash for days or weeks. E.g., I sometimes start on an idea and decide it's not worth pursuing (or more likely, I post a snippet of a patch as a "how about this" to the mailing list but don't plan on taking it further). Rather than run "git reset --hard", I usually "git stash" the result. That means if I really do decide I want it back, I can prowl through the stash list and find it.

All of which is to say that if we had such a feature, it should probably be optional. For some people it would be very useful, and for others it would be a nuisance.

Do you want to try a patch? I think you'd need to find the right spot in wt-status.c to show the output, and then call for_each_reflog_ent() on "refs/stash" and count the number of entries you see.

-Peff
Previous: Houston FortneyNext: Samuel Lijin
Message 2 of 13 in “Feature Request: Show status of the stash in git status command”
  1. Houston FortneyJun 7, 2017
  2. Jeff KingJun 10, 2017
  3. Samuel LijinJun 10, 2017
  4. Jeff KingJun 10, 2017
  5. liam BeguinJun 11, 2017
  6. Randall S. BeckerJun 11, 2017
  7. Igor DjordjevicJun 11, 2017
  8. Randall S. BeckerJun 11, 2017
  9. Junio C HamanoJun 12, 2017
  10. liam BeguinJun 13, 2017
  11. Konstantin KhomoutovJun 13, 2017
  12. liam BeguinJun 13, 2017
  13. Junio C HamanoJun 13, 2017

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.