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

Re: [PATCH 01/10] string_list: print_string_list to use trace_printf

From
Stefan Beller <sbeller@google.com>
Date
Aug 9, 2018, 21:40 UTC
Message-ID
<CAGZ79kZ-0R4qnZ7LMhncenOeoec3z+kNmt2_VqBKRiDXxKm6fQ@mail.gmail.com>
In-Reply-To
<xmqq7ekzb5qj.fsf@gitster-ct.c.googlers.com>
On Thu, Aug 9, 2018 at 2:16 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
>
> Stefan Beller <sbeller@google.com> writes:
>
> > It is a debugging aid, so it should print to the debugging channel.
>
> Who says?
The comment in the header file?
  /**
   * Dump a string_list to stdout, useful mainly for debugging
   * purposes. It can take an optional header argument and it writes out
   * the string-pointer pairs of the string_list, each one in its own
   * line.
   */
>  In-tree code may say so, and I do not think any in-flight
> topic up to 'pu' uses this to produce non-debugging output, but I do
> not think it is healthy attitude to assume that you can take over an
> existing function and change what it does unilaterally.

That is reasonable, as usual, and given the recent fallout of the object store refactoring I have these concerns on my mind, too.

But for this instance, I do not see any risk of accidental collisions with other series in flight:

$ git log -S print_string_list origin/pu --oneline 4f665f2cf33 string-list.h: move documentation from Documentation/api/ into header d10cb3dfab9 help.c: rename function "pretty_print_string_list" c455c87c5cd Rename path_list to string_list 1eb056905a2 include $PATH in generating list of commands for "help -a" 70827b15bfb Split up builtin commands into separate files from git.c 27dedf0c3b7 (tag: v1.0rc3, tag: v0.99.9j) GIT 0.99.9j aka 1.0rc3 8e49d503882 C implementation of the 'git' program, take two.

Show 5 quoted lines
> As there is no in-tree or in-flight user, I think it makes sense if
> the proposed change were to rename it to trace_string_list().  If
> there weren't any print_string_list() and we were adding a debugging
> aid to use trace_printf() to dump these, that would be the name we
> would use anyway.

Good call. I'll rename and send separately (or might even drop this patch completely; this patch is not used in the patches to follow; it is more a "FYI: here is a thing that I found helpful for debugging, unlike the existing function, which I found unhelpful and actively harmful")

Previous: Junio C HamanoNext: Stefan Beller
Message 4 of 27 in “fetch: make sure submodule oids are fetched”
  1. 00/10 fetch: make sure submodule oids are fetchedStefan Beller, Aug 8, 2018
  2. 01/10 string_list: print_string_list to use trace_printfStefan Beller, Aug 8, 2018
  3. Junio C HamanoAug 9, 2018
  4. Stefan BellerAug 9, 2018
  5. 02/10 string-list.h: add string_list_pop function.Stefan Beller, Aug 8, 2018
  6. Martin ÅgrenAug 9, 2018
  7. Junio C HamanoAug 9, 2018
  8. Jeff KingAug 9, 2018
  9. Stefan BellerAug 9, 2018
  10. Jeff KingAug 9, 2018
  11. Stefan BellerAug 9, 2018
  12. 03/10 sha1-array: provide oid_array_remove_ifStefan Beller, Aug 8, 2018
  13. Martin ÅgrenAug 9, 2018
  14. Stefan BellerAug 9, 2018
  15. Jeff KingAug 9, 2018
  16. Junio C HamanoAug 9, 2018
  17. Junio C HamanoAug 9, 2018
  18. 04/10 submodule.c: convert submodule_move_head new argument to object idStefan Beller, Aug 8, 2018
  19. Junio C HamanoAug 9, 2018
  20. 05/10 submodule.c: fix indentationStefan Beller, Aug 8, 2018
  21. 06/10 submodule.c: sort changed_submodule_names before searching itStefan Beller, Aug 8, 2018
  22. 07/10 submodule: move global changed_submodule_names into fetch submodule structStefan Beller, Aug 8, 2018
  23. 08/10 submodule.c: do not copy around submodule listStefan Beller, Aug 8, 2018
  24. 09/10 submodule: fetch in submodules git directory instead of in worktreeStefan Beller, Aug 8, 2018
  25. 10/10 fetch: retry fetching submodules if sha1 were not fetchedStefan Beller, Aug 8, 2018
  26. Martin ÅgrenAug 9, 2018
  27. Stefan BellerAug 9, 2018

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.