public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Amisha Chhajed <amishhhaaaa@gmail.com>
Cc: git@vger.kernel.org,  Derrick Stolee <stolee@gmail.com>,
	 Elijah Newren <newren@gmail.com>,  Jeff King <peff@peff.net>
Subject: Re: [RFC PATCH 1/2] Adding string_list_sort_u which sorts a list then deduplicates it.
Date: Thu, 22 Jan 2026 14:07:41 -0800	[thread overview]
Message-ID: <xmqqcy31l2s2.fsf@gitster.g> (raw)
In-Reply-To: <20260122171523.94234-2-amishhhaaaa@gmail.com> (Amisha Chhajed's message of "Thu, 22 Jan 2026 22:45:22 +0530")

Amisha Chhajed <amishhhaaaa@gmail.com> writes:

> string_list_remove_duplicates is almost always preceeded by
> string_list_sort, hence adding string_list_sort_u which dedupliactes
> post sorting.

The usual way to compose a log message of this project is to

 - Give an observation on how the current system works in the
   present tense (so no need to say "Currently X is Y", or
   "Previously X was Y" to describe the state before your change;
   just "X is Y" is enough), and discuss what you perceive as a
   problem in it.

 - Propose a solution (optional---often, problem description
   trivially leads to an obvious solution in reader's minds).

 - Give commands to somebody editing the codebase to "make it so",
   instead of saying "This commit does X".

in this order.

To those who have been intimately following the discussion, it often
is understandable without some of the above, but we are not writing
for those who review the patches.  We are primarily writing for future
readers of "git log" who are not aware of the review discussion we
have on list, so we should give something to prepare them by setting
the stage and stating the objective first, before going into how the
patch solved it.

With that in mind, perhaps something along this line ...


    Subject: string-list: add string_list_sort_u() that mimics "sort -u"

    Many callsites of string_list_remove_duplicates() call it
    immediately after calling string_list_sort().  It is
    understandable because the former requires the string-list to be
    sorted, but at the same time, it is clear that these places are
    sorting only to remove duplicates and for no other reason.

    Introduce a helper function string_list_sort_u() that combines
    these two calls that often appear together, to help simplify
    these callsites.

... probably?

The same comment applies to the way the other patch is explained.

Thanks.


  reply	other threads:[~2026-01-22 22:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22 17:15 [RFC PATCH 0/2] Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls Amisha Chhajed
2026-01-22 17:15 ` [RFC PATCH 1/2] Adding string_list_sort_u which sorts a list then deduplicates it Amisha Chhajed
2026-01-22 22:07   ` Junio C Hamano [this message]
2026-01-25 20:23     ` Amisha Chhajed
2026-01-22 17:15 ` [RFC PATCH 2/2] Replacing calls of string_list_sort and string_list_remove_duplicates with the combined variant string_list_u Amisha Chhajed
2026-01-22 22:19   ` Junio C Hamano
2026-01-22 22:09 ` [RFC PATCH 0/2] Adding string_list_sort_u to replace combined calls of string_list_sort and string_list_remove_duplicates calls Junio C Hamano
2026-01-25 20:14 ` [PATCH 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-25 20:15   ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-29 12:12     ` [PATCH v3 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-29 12:12       ` [PATCH v3 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-29 12:14       ` [PATCH v3 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-30 19:51     ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Kristoffer Haugsbakk
2026-01-30 21:45       ` Junio C Hamano
2026-01-26  7:12   ` [PATCH 1/2] u-string-list: add unit tests for string-list methods Junio C Hamano
2026-01-26 18:57     ` Amisha Chhajed
2026-01-26 19:12       ` Junio C Hamano
2026-01-25 20:17 ` Amisha Chhajed
2026-01-25 20:17   ` [PATCH 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-26 18:56 ` [PATCH v2 1/2] u-string-list: add unit tests for string-list methods Amisha Chhajed
2026-01-26 18:56   ` [PATCH v2 2/2] string-list: add string_list_sort_u() that mimics "sort -u" Amisha Chhajed
2026-01-26 20:11     ` Junio C Hamano
2026-01-27  1:27       ` Amisha Chhajed
2026-01-26 19:50   ` [PATCH v2 1/2] u-string-list: add unit tests for string-list methods Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqcy31l2s2.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=amishhhaaaa@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox