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

Reference to a commit inside a commit message

From
enzodicicco@gmail.com <enzodicicco@gmail.com>
Date
Apr 28, 2014, 18:35 UTC
Message-ID
<20140428183552.GA9709@workstation.Belkin>

Hi to all, I'm trying to figure out what is the best way (and if it exists) to link a message of a commit to another commit. I start by saying I don't know Git very well so maybe this question can be very trival for someone but I've googled and searched into the Mailing List with little success.

The goal would be to be able to refer to a specific commit (or a set of it) through its Hash in order to justify some actions done in a commit, mantaining the message compact.
Obviously I don't mean to put the raw Hash, rather I would be happy to find a way to automatize the visits and the insertions of the commits inside the message.
What I mean is  what Gitweb do, naturally adapted for the use of Git through shell.
For example, thinking about it, I've imagined to add this feature to `git commit`:
    git commit --see-also <commit1> <commit2> ...
that adds a label (like "Signed-off-by") such as:
    See-also:
        1: <commit 1>
        2: <commit 2>
        ...
And, to other side, `git show` could have a feature like this:
    git show <commit> --see-also 1
that simply call `git show <commit-1>`.

So, there is a better way to obtain a behaviour like this? Has ever been discussed the possibility of implementing a similar feature? and There is a way to handle a similar behaviour through Hooks?

Thanks to all, NaN

Next: Jonathan Nieder
Message 1 of 7 in “Reference to a commit inside a commit message”
  1. enzodicicco@gmail.comApr 28, 2014
  2. Jonathan NiederApr 28, 2014
  3. Vincenzo di CiccoApr 28, 2014
  4. Jeff KingApr 29, 2014
  5. Felipe ContrerasApr 29, 2014
  6. Vincenzo di CiccoApr 29, 2014
  7. Vincenzo di CiccoApr 30, 2014

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.