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

[PATCH] document how to reference previous commits

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jul 28, 2016, 12:55 UTC
Message-ID
<20160728125514.GA2813@sandbox>
In-Reply-To
<20160728111636.GA7760@sandbox>

To reference previous commits people used to put just the abbreviated SHA-1 into commit messages. This is what has evolved as a more stable format for referencing commits. So lets document it for everyone to lookup when needed.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
On Thu, Jul 28, 2016 at 01:16:36PM +0200, Heiko Voigt wrote:
Show 15 quoted lines
> On Tue, Jul 26, 2016 at 10:22:07AM -0700, Stefan Beller wrote:
> > Usually we refer to the commit by a triple of "abbrev. sha1 (date, subject).
> > See d201a1ecd (2015-05-21, test_bitmap_walk: free bitmap with bitmap_free)
> > for an example. Or ce41720ca (2015-04-02, blame, log: format usage strings
> > similarly to those in documentation).
> > 
> > Apparently we put the subject first and then the date. I always did it
> > the other way
> > round, to there is no strict coding guide line, though it helps a lot to have an
> > understanding for a) how long are we in the "broken" state already as well as
> > b) what was the rationale for introducing it.
> 
> Ah ok did not know about this format. Will change that. I also will
> follow-up with a patch to document this in SubmittingPatches so we can
> point others to that...

Here we go. Made this a seperate patch, since it is not really connected to the submodule-config-fix series.

Cheers Heiko
 Documentation/SubmittingPatches | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index e8ad978..500230c 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -121,6 +121,11 @@ its behaviour.  Try to make sure your explanation can be understood
 without external resources. Instead of giving a URL to a mailing list
 archive, summarize the relevant points of the discussion.
 
+If you want to reference a previous commit in the history of a stable
+branch use the format "abbreviated sha1 (subject, date)". So for example
+like this: "Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
+noticed [...]".
+
 
 (3) Generate your patch using Git tools out of your commits.
 
-- 
2.0.2.832.g083c931
Previous: Heiko VoigtNext: Junio C Hamano
Message 18 of 23 in “submodule-config: use explicit empty string instead of strbuf in config_from()”
  1. submodule-config: use explicit empty string instead of strbuf in config_from()René Scharfe, Jul 19, 2016
  2. Junio C HamanoJul 19, 2016
  3. Stefan BellerJul 19, 2016
  4. Heiko VoigtJul 20, 2016
  5. René ScharfeJul 21, 2016
  6. Heiko VoigtJul 25, 2016
  7. Junio C HamanoJul 25, 2016
  8. 2/2 submodule-config: combine error checking if clausesHeiko Voigt, Jul 26, 2016
  9. Stefan BellerJul 26, 2016
  10. 1/2 fix passing a name for config from submodulesHeiko Voigt, Jul 26, 2016
  11. Stefan BellerJul 26, 2016
  12. Junio C HamanoJul 26, 2016
  13. 1/3 submodule-config: passing name reference for .gitmodule blobsHeiko Voigt, Jul 28, 2016
  14. Stefan BellerJul 28, 2016
  15. 2/3 submodule-config: combine early return code into one gotoHeiko Voigt, Jul 28, 2016
  16. 3/3 submodule-config: fix test binary crashing when no arguments givenHeiko Voigt, Jul 28, 2016
  17. Heiko VoigtJul 28, 2016
  18. document how to reference previous commitsHeiko Voigt, Jul 28, 2016
  19. Junio C HamanoJul 28, 2016
  20. Stefan BellerJul 28, 2016
  21. Heiko VoigtAug 17, 2016
  22. Junio C HamanoAug 17, 2016
  23. Junio C HamanoJul 28, 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.