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

Re: [git] Re: Bug in git-stash(.sh) ?

From
JKJeff King <peff-adepduraxsq@public.gmane.org>
Date
May 4, 2012, 05:21 UTC
Message-ID
<20120504052106.GA15970@sigill.intra.peff.net>
In-Reply-To
<20386.53745.200846.115335-a5nvgYPMCZcx/1z6v04GWfZ8FUJU4vz8@public.gmane.org>
On Thu, May 03, 2012 at 02:44:01PM -0400, Eli Barzilay wrote:
Show 8 quoted lines
> > Once that is fixed, then we can consider whether something more should
> > happen for stash (though I am inclined to say that is enough; it is a
> > feature that you can do "git stash list --date=relative" to see the
> > stash timestamps).
> 
> Since the general problem is bigger, how about just the quick patch of
> adding --date=default in the list_stash function as a stopgap?  That
> seems to be close enough to how it should work anyway.

It is bigger in scope, but the fix is still pretty small. I was trying to trick^W gently prod you into making a patch, but that does not seem to have worked. :) So here is a series that fixes it, and we don't have to worry about a stopgap.

  [1/4]: t1411: add more selector index/date tests
  [2/4]: log: respect date_mode_explicit --format:%gd
  [3/4]: reflog-walk: clean up "flag" field of commit_reflog struct
  [4/4]: reflog-walk: always make HEAD@{0} show indexed selectors

The first two fix and test the bug I mentioned, and as a result solve the stash problem. The second two fix and test the bug that Junio mentioned. This doesn't affect stash, but it's the right thing for "git log" to do.

Show 16 quoted lines
> > >   * Some new %gi uses the index number: stash@{1}, and %gI produces
> > >     refs/stash@{1}, unrelated to any date setting
> > >   * git-stash.sh uses %gi so the output has the numbers
> > >   * Some new option for "stash list" for the format string, so it's
> > >     possible to show the dates if you want to with something like
> > >     git stash list --format:"%gi: %gs (%gd)"
> > 
> > I don't have a huge problem with that. But what issue is it really
> > solving? Are people using "git stash list --date=iso" and then
> > getting confused by the output? Or is it simply a matter of
> > mistakenly applying the config when it should not be? The latter
> > needs fixed in either case.
> 
> It's basically an attempt to have a %gi that is disconnected from date
> options (config or flags), which solves the config problem in a
> trivial way (no date options are used)...

I don't have a problem at all with %gi; I think it would be a good addition. I just think that stash shouldn't use, as the "--date" thing is a feature that there is no reason to deny to stash users (it just needs to be less buggy :) ).

-Peff
Previous: Eli BarzilayNext: Jeff King
Message 14 of 26 in “Bug in git-stash(.sh) ?”
  1. Eli BarzilayApr 27, 2012
  2. Junio C HamanoApr 27, 2012
  3. Eli BarzilayApr 28, 2012
  4. Andreas SchwabApr 28, 2012
  5. Yann HodiqueApr 28, 2012
  6. Eli BarzilayApr 28, 2012
  7. Jeff KingApr 29, 2012
  8. Junio C HamanoApr 29, 2012
  9. Eli BarzilayApr 29, 2012
  10. Jeff KingMay 1, 2012
  11. Eli BarzilayApr 29, 2012
  12. Jeff KingMay 1, 2012
  13. [git] Re: Bug in git-stash(.sh) ?Eli Barzilay, May 3, 2012
  14. Jeff KingMay 4, 2012
  15. 3/4 reflog-walk: clean up "flag" field of commit_reflog structJeff King, May 4, 2012
  16. 1/4 t1411: add more selector index/date testsJeff King, May 4, 2012
  17. 2/4 log: respect date_mode_explicit with --format:%gdJeff King, May 4, 2012
  18. 4/4 reflog-walk: always make HEAD@{0} show indexed selectorsJeff King, May 4, 2012
  19. Junio C HamanoMay 4, 2012
  20. Eli BarzilayMay 4, 2012
  21. Eli BarzilayMay 4, 2012
  22. Jeff KingMay 7, 2012
  23. Jeff KingMay 10, 2012
  24. Junio C HamanoMay 10, 2012
  25. OT: gmane address mangling selectorsJeff King, May 10, 2012
  26. Eli BarzilayMay 10, 2012

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.