{"thread":{"id":"64669","subject":"[PATCH] xdiff: fix outdated xpatience comments referring to \"ha\" member var","startedAt":"2025-12-23T04:41:48Z","lastAt":"2025-12-23T04:41:48Z","messageCount":1,"participants":["Yee Cheng Chin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"532638","messageId":"pull.2139.git.git.1766464905719.gitgitgadget@gmail.com","threadId":"64669","inReplyTo":null,"subject":"[PATCH] xdiff: fix outdated xpatience comments referring to \"ha\" member var","fromName":"Yee Cheng Chin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-12-23T04:41:45Z","receivedAt":"2025-12-23T04:41:48Z","isPatch":true,"sender":{"key":"ychin.macvim@gmail.com","avatar":null},"body":"From: Yee Cheng Chin <ychin.git@gmail.com>\n\nThe `ha` member variable was refactored to separate `line_hash` and\n`minimal_perfect_hash` ones in 6a26019c81f. However, there is a\nstale comment in xpatience.c that still refers to it. Fix the comment to\nmake sure it is consistent with code.\n\nSigned-off-by: Yee Cheng Chin <ychin.git@gmail.com>\n---\n    xdiff: Fix outdated comments referring to \"ha\" member var\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2139%2Fychin%2Ffix-patience-diff-wrong-ha-docs-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2139/ychin/fix-patience-diff-wrong-ha-docs-v1\nPull-Request: https://github.com/git/git/pull/2139\n\n xdiff/xpatience.c | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/xdiff/xpatience.c b/xdiff/xpatience.c\nindex 9580d18032..ec65932e21 100644\n--- a/xdiff/xpatience.c\n+++ b/xdiff/xpatience.c\n@@ -92,14 +92,13 @@ static void insert_record(xpparam_t const *xpp, int line, struct hashmap *map,\n \t\tmap->env->xdf1.recs : map->env->xdf2.recs;\n \txrecord_t *record = &records[line - 1];\n \t/*\n-\t * After xdl_prepare_env() (or more precisely, due to\n-\t * xdl_classify_record()), the \"ha\" member of the records (AKA lines)\n-\t * is _not_ the hash anymore, but a linearized version of it.  In\n-\t * other words, the \"ha\" member is guaranteed to start with 0 and\n-\t * the second record's ha can only be 0 or 1, etc.\n+\t * The \"minimal_perfect_hash\" member of the records (AKA lines) is a\n+\t * linearized version of the hash.  In other words, it is guaranteed to\n+\t * start with 0 and the second record's minimal_perfect_hash can only\n+\t * be 0 or 1, etc.\n \t *\n-\t * So we multiply ha by 2 in the hope that the hashing was\n-\t * \"unique enough\".\n+\t * So we multiply minimal_perfect_hash by 2 in the hope that the\n+\t * hashing was \"unique enough\".\n \t */\n \tint index = (int)((record->minimal_perfect_hash << 1) % map->alloc);\n \n\nbase-commit: c8d76f7325e75c6f0549fce29ea4f3d97eb079cb\n-- \ngitgitgadget\n"}]}