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

Re: [RFC PATCH v2] revision: new rev^-n shorthand for rev^n..rev

From
Jakub Narębski <jnareb@gmail.com>
Date
Sep 25, 2016, 14:19 UTC
Message-ID
<ab725c6e-5c8f-d137-fefc-7f094ea7b7bb@gmail.com>
In-Reply-To
<20160925085511.12515-1-vegard.nossum@oracle.com>
W dniu 25.09.2016 o 10:55, Vegard Nossum pisze:
Show 13 quoted lines
> I use rev^..rev daily, and I'm surely not the only one. To save typing
> (or copy-pasting, if the rev is long -- like a full SHA-1 or branch name)
> we can make rev^- a shorthand for that.
> 
> The existing syntax rev^! seems like it should do the same, but it
> doesn't really do the right thing for merge commits (it gives only the
> merge itself).
> 
> As a natural generalisation, we also accept rev^-n where n excludes the
> nth parent of rev, although this is expected to be generally less useful.
> 
> [v2: Use ^- instead of % as suggested by Junio Hamano and use some
>  common helper functions for parsing.]

Minor sidenote: the above should go after the "---" line, as it should be not included in the final commit message.

Show 8 quoted lines
> 
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
>  Documentation/revisions.txt | 14 +++++++
>  builtin/rev-parse.c         | 28 ++++++++++++++
>  revision.c                  | 91 +++++++++++++++++++++++++++++++++++++++++++++
>  revision.h                  |  1 +
>  4 files changed, 134 insertions(+)
Previous: Ramsay JonesNext: Philip Oakley
Message 4 of 7 in “revision: new rev^-n shorthand for rev^n..rev”
  1. revision: new rev^-n shorthand for rev^n..revVegard Nossum, Sep 25, 2016
  2. Matthieu MoySep 25, 2016
  3. Ramsay JonesSep 25, 2016
  4. Jakub NarębskiSep 25, 2016
  5. Philip OakleySep 25, 2016
  6. Junio C HamanoSep 26, 2016
  7. Philip OakleySep 26, 2016

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.