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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Earlier today, Andreas Schwab wrote:
> 
> FWIW, replacing the spaces by dots will avoid the bug.

(Yeah, but I don't see a quick way to do that replacement without
resorting to bashisms.)


Yesterday, Eli Barzilay wrote:
> I didn't like that either, and I think that it's possible to avoid
> it by dropping the --symbolic for that test, and re-parse if needed
> for an error messag.  I'll try that and send a patch.

I'm attaching a patch rather than including it inline since it's
bigger than I thought, and since I'm not sure that it should be used.
It makes the script use $REV for sha1 revisions, and $SREV for the
--symbolic versions that were used previously.  With this, date refs
work for "stash apply" but they *don't* work for "stash drop" -- looks
like a number is required for that.

However, I thought that a much better solution is to not show the
dates to begin with, since that would make things work as expected...
The fact that things seem to be working fine for the whole world
except for me made me look into my config file, and ...

Three hours ago, Yann Hodique wrote:
> 
> How exactly do you make magit generate these calls?  AFAICT, Magit
> should operate on whatever "git stash list" outputs, meaning
> stash@{N}. So I guess I'm missing something.

... right: the offending configuration I had was log.date = iso.  This
calls for a simple chane for git-stash.sh to use `--date default':

	git log --date default --format="%gd: %gs" -g "$@" $ref_stash --

which follows.  This is independent of the other patch.  In any case,
it is also questionable -- reading the documentation for %gd:

           ·    %gD: reflog selector, e.g., refs/stash@{1}
           ·    %gd: shortened reflog selector, e.g., stash@{1}

makes it look like the problem is there -- in get_reflog_selector() --
which has explicit code for showing the dates.  (This was done in
8f8f5476.)

Another point is being able to see these dates, eg, make "stash list"
show the stash{N} and also show the dates.  It looks to me like the
date code in get_reflog_selector() should be *removed* since it can be
printed with "%cd" or "%ad" in the log line.  And it might be nicer to
add the date to the "stash list" output, something like:

	git log --date default --format="%gd: %gs (%cd)" -g "$@" $ref_stash --


This is the patch mentioned in the beginning:

Attachment: srev-patch
Description: Binary data

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]