[PATCH 6/6 v5] sha1_name.c: avoid parsing @{-1} unnecessarily

2017-03-13 Thread mash
Move dash is previous branch check to get_sha1_basic. Introduce helper function that gets nth prior branch switch from reflog. Signed-off-by: mash --- RE: [PATCH 4/6 v5] sha1_name.c: teach get_sha1_1 "-" shorthand for "@{-1}" > + if (*name == '-' &&

RE: [PATCH v2 GSoC RFC] diff: allow "-" as a short-hand for "last branch"

2017-03-09 Thread mash
be too stupid to search through the mailing list archive properly. Maybe you can reuse the diff tests. I'll do another microproject then. mash The original message doesn't seem to cc the mailing list: > Hey, I have already worked on this, and I made the change inside > sha1_name.c.

[PATCH v2 GSoC RFC] diff: allow "-" as a short-hand for "last branch"

2017-03-09 Thread mash
ation to allow the use of "git diff -..HEAD^" as a short-hand for "git diff @{-1}..HEAD^". Signed-off-by: mash --- Add tests to confirm that passing in this short-hand from stdin works. Handling the dash in sha1_name:get_sha1_basic is not an issue but git was designed with th

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

2017-03-08 Thread mash
ation to allow the use of "git diff -..HEAD^" as a short-hand for "git diff @{-1}..HEAD^". Signed-off-by: mash --- This is a GSoC microproject. I'm not sure how useful this change is. Please review it and take it apart. I'm not very happy with the change of handle_re