git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Thomas Gummerer <t.gummerer@gmail.com>
Subject: [PATCH 2/4] rerere: fix comment on handle_file() helper
Date: Thu, 24 Aug 2023 13:54:54 -0700	[thread overview]
Message-ID: <20230824205456.1231371-3-gitster@pobox.com> (raw)
In-Reply-To: <20230824205456.1231371-1-gitster@pobox.com>

The return value from handle_path() is returned to the caller of
handle_file() in the normal cases, and it is not the number of
hunks. It is just a normal C Boolean, "do we (!=0) or do we not (0)
have conflict?" plus "a negative return value signals an error".

And all the callers of handle_file() understands its return value as
such.  Update the comment to match the reality after 221444f5
(rerere: only return whether a path has conflicts or not,
2018-08-05), which apparently forgot to update this comment when it
turned the returned value of this function from the number of
conflict hunks to a boolean plus error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

---
cc: Thomas Gummerer <t.gummerer@gmail.com>
---
 rerere.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rerere.c b/rerere.c
index 73cdc8392f..4ce1270a94 100644
--- a/rerere.c
+++ b/rerere.c
@@ -454,7 +454,7 @@ static int handle_path(unsigned char *hash, struct rerere_io *io, int marker_siz
 
 /*
  * Scan the path for conflicts, do the "handle_path()" thing above, and
- * return the number of conflict hunks found.
+ * return true iff conflict hunks were found.
  */
 static int handle_file(struct index_state *istate,
 		       const char *path, unsigned char *hash, const char *output)
-- 
2.42.0-29-gcd9da15a85


  parent reply	other threads:[~2023-08-24 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 20:54 [PATCH 0/4] code clean-up for rerere Junio C Hamano
2023-08-24 20:54 ` [PATCH 1/4] rerere: simplify check_one_conflict() helper function Junio C Hamano
2023-08-24 20:54 ` Junio C Hamano [this message]
2023-08-24 20:54 ` [PATCH 3/4] rerere: try_merge() should use LL_MERGE_ERROR when it means an error Junio C Hamano
2023-08-24 20:54 ` [PATCH 4/4] rerere: modernize use of empty strbuf 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=20230824205456.1231371-3-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=t.gummerer@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;
as well as URLs for NNTP newsgroup(s).