{"thread":{"id":"46518","subject":"bug: git stash list --format='%gd' --date=format:'…'","startedAt":"2017-08-05T19:06:08Z","lastAt":"2017-08-05T19:06:08Z","messageCount":1,"participants":["Stephen Talley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"325641","messageId":"20170805190553.GA12649@nerd","threadId":"46518","inReplyTo":null,"subject":"bug: git stash list --format='%gd' --date=format:'…'","fromName":"Stephen Talley","fromEmail":"stephentalley@nerdysoftware.com","sentAt":"2017-08-05T19:05:53Z","receivedAt":"2017-08-05T19:06:08Z","isPatch":false,"sender":{"key":"stephentalley@nerdysoftware.com","avatar":null},"body":"Synopsis:\n\nWhen expanding '%gd' placeholder (reflog selector), git substitutes user-specified --date format, which mangles the reflog.\n\nDescription:\n\nI was writing a script that expects a stash reflog and a date on stdin:\n\n    % git stash list --format='%gd%n%ad'\n    stash@{0}\n    Sat Aug 5 13:26:30 2017 -0400\n    stash@{1}\n    Sat Aug 5 13:18:54 2017 -0400\n    …\n\nSince this date is going to be presented to the user, I wanted to apply my own date format:\n\n    % git stash list --format='%gd%n%ad' --date=format:%Y/%m/%d\n    stash@{2017/08/05}\n    2017/08/05\n    stash@{2017/08/05}\n    2017/08/05\n    …\n\nUnfortunately this mangles the reflog as well (e.g. \"stash@{2017/08/05}\"), making it useless when passed back to git.\n\nApparently stashes can be referenced by date, which is fine I suppose.  But those dates should never be subject to user-defined formatting via --date=format:….\n\nI'd expect the above command to instead output:\n\n    % git stash list --format='%gd%n%ad' --date=format:%Y/%m/%d\n    stash@{0}\n    2017/08/05\n    stash@{1}\n    2017/08/05\n    …\n\nor at least always use the ISO date format:\n\n    % git stash list --format='%gd%n%ad'\n    stash@{2017-08-05 13:26:30 -0400}\n    2017-08-05 13:26:30 -0400\n    stash@{2017-08-05 13:18:54 -0400}\n    2017-08-05 13:18:54 -0400\n    …\n\nSteve\n"}]}