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

Re: [PATCHv4 6/7] builtin/describe.c: factor out describe_commit

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Nov 15, 2017, 01:44 UTC
Message-ID
<20171114174458.48e345602d6cb3b2614941ef@google.com>
In-Reply-To
<20171115003043.24080-7-sbeller@google.com>

On Tue, 14 Nov 2017 16:30:42 -0800 Stefan Beller <sbeller@google.com> wrote:

Show 8 quoted lines
> In the next patch we'll learn how to describe more than just commits,
> so factor out describing commits into its own function.  That will make
> the next patches easy as we still need to describe a commit as part of
> describing blobs.
> 
> While factoring out the functionality to describe_commit, make sure
> that any output to stdout is put into a strbuf, which we can print
> afterwards, using puts which also adds the line ending.

I think the sentences here are a bit jumbled. The aim is to make the next patch easier (your 2nd sentence), and how we accomplish that is by factoring out the description of commits (1st sentence) *and* by outputting to a strbuf because we need to postprocess the output further when describing a commit as part of describing a blob (3rd sentence).

Previous: Stefan BellerNext: Stefan Beller
Message 10 of 17 in “[PATCHv4 0/7] describe a blob”
  1. Stefan BellerNov 15, 2017
  2. 1/7 t6120: fix typo in test nameStefan Beller, Nov 15, 2017
  3. 3/7 revision.h: introduce blob/tree walking in order of the commitsStefan Beller, Nov 15, 2017
  4. Jonathan TanNov 15, 2017
  5. 4/7 builtin/describe.c: rename `oid` to avoid variable shadowingStefan Beller, Nov 15, 2017
  6. 2/7 list-objects.c: factor out traverse_trees_and_blobsStefan Beller, Nov 15, 2017
  7. 5/7 builtin/describe.c: print debug statements earlierStefan Beller, Nov 15, 2017
  8. Jonathan TanNov 15, 2017
  9. 6/7 builtin/describe.c: factor out describe_commitStefan Beller, Nov 15, 2017
  10. Jonathan TanNov 15, 2017
  11. 7/7 builtin/describe.c: describe a blobStefan Beller, Nov 15, 2017
  12. Jonathan TanNov 15, 2017
  13. Stefan BellerNov 16, 2017
  14. Junio C HamanoNov 16, 2017
  15. Stefan BellerNov 16, 2017
  16. Junio C HamanoNov 16, 2017
  17. Junio C HamanoNov 17, 2017

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.