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

Re: [PATCH v2 1/2] for-each-ref: re-structure code for moving to 'ref-filter'

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 26, 2015, 15:49 UTC
Message-ID
<vpqpp5nfiea.fsf@anie.imag.fr>
In-Reply-To
<xmqqegm4bmtg.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Yuck; I can see what you are doing but can you imitate what the more
> experienced people (e.g. peff, mhagger) do when restructuring
> existing code and do things in smaller increments?
Seconded. Some reasons/guide to split:
* Split trivial and non-trivial stuff. I can quickly review a
  "rename-only" patch even if it's a bit long (essentially, I'll check
  that you did find-and-replace properly), but reviewing a mix of
  renames and actual code change is hard.
* Split controversial and non-controversial stuff. For example, you
  changed the ordering of fields in a struct. Perhaps it was not a good
  idea. Perhaps it was a good idea, but then you want this reordering to
  be alone in its patch so that you can explain why it's a good idea in
  the commit message (you'll see me use the word "why" a lot when
  talking about commit messages; not a coincidence).
* Split code movement and other stuff. For example extraction of
  match_name_as_path() would be trivial if made in its own patch.

I'd also make a separate patch "introduce the ref_list data-structure" to introduce struct ref_list and basic helper functions (constructors, mutators, destructors).

It will take time and may appear to be counter-productive at first, but you'll get used to it, and you'll end up being actually more productive this way (well, maybe not "you" but the set "you + reviewers").

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Karthik NayakNext: Karthik Nayak
Message 7 of 10 in “Ref-filter: unification of 'tag -l', 'branch -l' and 'for-each-ref'”
  1. Karthik NayakMay 25, 2015
  2. 1/2 for-each-ref: re-structure code for moving to 'ref-filter'Karthik Nayak, May 25, 2015
  3. Junio C HamanoMay 25, 2015
  4. Karthik NayakMay 25, 2015
  5. Junio C HamanoMay 25, 2015
  6. Karthik NayakMay 26, 2015
  7. Matthieu MoyMay 26, 2015
  8. Karthik NayakMay 28, 2015
  9. Matthieu MoyMay 28, 2015
  10. 2/2 ref-filter: move code from 'for-each-ref'Karthik Nayak, May 25, 2015

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.