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

[WIP PATCH 1/6] diff-lib.c: fix misleading comments on oneway_diff()

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2009, 05:06 UTC
Message-ID
<1253423175-6339-2-git-send-email-gitster@pobox.com>
In-Reply-To
<1253423175-6339-1-git-send-email-gitster@pobox.com>

20a16eb (unpack_trees(): fix diff-index regression., 2008-03-10) adjusted diff-index to the new world order since 34110cd (Make 'unpack_trees()' have a separate source and destination index, 2008-03-06). Callbacks are expected to return anything non-negative as "success", and instead of reporting how many index entries they have processed, they are expected to advance o->pos themselves. The code did so, but a stale comment was left behind.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff-lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index 0c74ef5..adf1c5f 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -383,7 +383,7 @@ static inline void skip_same_name(struct cache_entry *ce, struct unpack_trees_op
  * For diffing, the index is more important, and we only have a
  * single tree.
  *
- * We're supposed to return how many index entries we want to skip.
+ * We're supposed to advance o->pos to skip what we have already processed.
  *
  * This wrapper makes it all more readable, and takes care of all
  * the fairly complex unpack_trees() semantic requirements, including
-- 
1.6.5.rc1.90.ga3b1b
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 7 in “Merging with D/F conflicts”
  1. 0/6 Merging with D/F conflictsJunio C Hamano, Sep 20, 2009
  2. 1/6 diff-lib.c: fix misleading comments on oneway_diff()Junio C Hamano, Sep 20, 2009
  3. 2/6 unpack-trees: typofixJunio C Hamano, Sep 20, 2009
  4. 3/6 unpack_callback(): use unpack_failed() consistentlyJunio C Hamano, Sep 20, 2009
  5. 4/6 traverse_trees(): handle D/F conflict case sanelyJunio C Hamano, Sep 20, 2009
  6. 5/6 unpack-trees.c: prepare for looking ahead in the indexJunio C Hamano, Sep 20, 2009
  7. 6/6 read-tree --debug-unpackJunio C Hamano, Sep 20, 2009

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.