Skip to contentSkip to conversation

diff: allow "-" as a short-hand for "last branch"

RFC PATCH New Siddharth Kannan 1 participant 1 message Mar 10, 2017

lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 diff: allow "-" as a short-hand for "last branch"

Hey, I have already worked on this, and I made the change inside sha1_name.c.

The final version of my patch is here[1].

Quoted 8 lines

Handling the dash in sha1_name:get_sha1_basic is not an issue but git
was designed with the dash in mind for options not for this weird short-hand so as long as there's no decision made that git should actually have this short-hand everywhere it does not seem like a good
idea to change anything in there because it would probably have unwanted side-effects.

Actually, this was discussed even when I was working on this patch.

I said [2]

Quoted 5 lines

Making a change in sha1_name.c will touch a lot of commands (setup_revisions is called from everywhere in the codebase), so, I am
still trying to figure out how to do this such that the rest of the codepath remains unchanged.

Matthieu replied to this [3]

Quoted 5 lines

I don't have strong opinion on this: I tend to favor consistency and supporting "-" everywhere goes in this direction, but I think the downsides should be considered too. A large part of the exercice here
is to write a good commit message!

From the discussion over the different versions of my patch, I get the feeling that enabling this shorthand for all the commands is the direction that git wants to move in.

Sorry about the time you spent on this patch.

[1]: http://public-inbox.org/git/[email protected]/
[2]: https://public-inbox.org/git/[email protected]/
[3]: https://public-inbox.org/git/[email protected]/

Thanks,
Siddharth.

P.S. This message was sent _before_ [email protected] but I didn't CC The mailing list in that message. I am sending it with the mailing list cc-ed to ensure that the conversation makes sense.