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

[PATCH/RFC 0/4] Adding '-' notation as @{-1} (pu, d40f108)

From
KCKenny Lee Sin Cheong <kenny.lee28@gmail.com>
Date
Mar 30, 2015, 17:41 UTC
Message-ID
<1427737315-7229-1-git-send-email-kenny.lee28@gmail.com>

This is an attempt to allow '-' everywhere a revision is normally allowed. I previously attempted this as a microproject and the subject was disscussed at : http://article.gmane.org/gmane.comp.version-control.git/265672

Currently, something like '-~2' does not work. I tried tracing the execution of, say 'log -~2' vs 'log master -~2' and noticed when calling dwim_ref() with '-~2', it returns 0 (no refs found) whereas when given 'master~2', it returned non-zero. However I'm not sure how exactly dwim_ref() works.
Kenny Lee Sin Cheong (4):
  Add "-" as @{-1} support for the rev-parse command
  t1505: add tests for '-' notation in rev-parse
  Handle arg as revision first, then option.
  t0102: add tests for '-' notation
 builtin/rev-parse.c           | 37 +++++++++++++-------------
 revision.c                    | 61 +++++++++++++++++++++++--------------------
 sha1_name.c                   |  2 +-
 t/t0102-previous-shorthand.sh | 40 ++++++++++++++++++++++++++++
 t/t1505-rev-parse-last.sh     | 12 ++++++---
 5 files changed, 101 insertions(+), 51 deletions(-)
 create mode 100644 t/t0102-previous-shorthand.sh
-- 
2.3.3.203.g8ffb468.dirty
Next: Kenny Lee Sin Cheong
Message 1 of 7 in “Adding '-' notation as @{-1} (pu, d40f108)”
  1. 0/4 Adding '-' notation as @{-1} (pu, d40f108)Kenny Lee Sin Cheong, Mar 30, 2015
  2. 1/4 Add "-" as @{-1} support for the rev-parse commandKenny Lee Sin Cheong, Mar 30, 2015
  3. Junio C HamanoMar 30, 2015
  4. 2/4 t1505: add tests for '-' notation in rev-parseKenny Lee Sin Cheong, Mar 30, 2015
  5. Torsten BögershausenMar 31, 2015
  6. 3/4 Handle arg as revision first, then option.Kenny Lee Sin Cheong, Mar 30, 2015
  7. 4/4 t0102: add tests for '-' notationKenny Lee Sin Cheong, Mar 30, 2015

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.