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

Re: [PATCH v2 00/19] add strbuf_set operations

From
Jeremiah Mahler <jmmahler@gmail.com>
Date
Jun 12, 2014, 07:09 UTC
Message-ID
<20140612070932.GA25353@hudson.localdomain>
In-Reply-To
<CAPig+cRJJ6byQi6+=+8r3Ohyt9FvMHwQViq+MNR1DcD2t8w+NQ@mail.gmail.com>
Eric,
On Wed, Jun 11, 2014 at 04:09:17AM -0400, Eric Sunshine wrote:
Show 7 quoted lines
> On Mon, Jun 9, 2014 at 6:19 PM, Jeremiah Mahler <jmmahler@gmail.com> wrote:
> > Version 2 of the patch set to add strbuf_set operations.
> >
> > Includes suggestions from Eric Sunshine [1]:
> >
> > [...snip...]
> >
...
Show 32 quoted lines
> 
> Food for thought: This patch series has now likely entered the
> territory of unnecessary code churn. Quoting from
> Documentation/CodingGuidelines:
> 
>     Fixing style violations while working on a real change as a
>     preparatory clean-up step is good, but otherwise avoid useless
>     code churn for the sake of conforming to the style.
> 
>     "Once it _is_ in the tree, it's not really worth the patch noise
>     to go and fix it up."
>     Cf. http://article.gmane.org/gmane.linux.kernel/943020
> 
> Rewriting code merely for the sake of replacing strbuf_reset() +
> strbuf_add() with strbuf_set(), while not exactly a style cleanup,
> falls into the same camp. (The patch which introduces strbuf_set(),
> however, is not churn.) Each change you make can potentially conflict
> with other topics already in-flight (see [1], for example), thus
> making more work for Junio.
> 
> Also, these sorts of apparently innocuous "mechanical" changes can
> have hidden costs [2], so it's useful to weigh carefully how lengthy
> you want to make this patch series.
> 
> Having said that, patch 4/19, particularly the changes to
> builtin/remote.c:mv(), in which multiple strbufs are reused
> repeatedly, does seem to make the code a bit easier to read and likely
> reduces cognitive load.
> 
> [1]: http://thread.gmane.org/gmane.comp.version-control.git/245133/focus=245147
> [2]: http://thread.gmane.org/gmane.comp.version-control.git/245133/focus=245144
> 

I did not realize this "code churn" aspect at the time but it makes sense now. These "mechanical" changes can be more trouble than they are worth.

I will try to re-focus my changes to only those that have a substantial benefit.

-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler
Previous: Eric Sunshine
Message 28 of 28 in “add strbuf_set operations”
  1. 00/19 add strbuf_set operationsJeremiah Mahler, Jun 9, 2014
  2. 01/19 add strbuf_set operationsJeremiah Mahler, Jun 9, 2014
  3. Eric SunshineJun 11, 2014
  4. Jeremiah MahlerJun 12, 2014
  5. Michael HaggertyJun 11, 2014
  6. Jeremiah MahlerJun 12, 2014
  7. Michael HaggertyJun 12, 2014
  8. Jeremiah MahlerJun 12, 2014
  9. 02/19 sha1_name: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  10. 03/19 fast-import: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  11. 04/19 builtin/remote: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  12. 05/19 branch: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  13. 06/19 builtin/branch: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  14. 07/19 builtin/checkout: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  15. 08/19 builtin/mailinfo: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  16. 09/19 builtin/tag: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  17. 10/19 date: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  18. 11/19 diffcore-order: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  19. 12/19 http-backend: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  20. 13/19 http: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  21. 14/19 ident: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  22. 15/19 remote-curl: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  23. 16/19 submodule: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  24. 17/19 transport: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  25. 18/19 vcs-svn/svndump: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  26. 19/19 wt-status: simplify via strbuf_set()Jeremiah Mahler, Jun 9, 2014
  27. Eric SunshineJun 11, 2014
  28. Jeremiah MahlerJun 12, 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.