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

[PATCH v2 4/7] wt-status.c: rename wt_status_change_data::score

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Dec 26, 2017, 09:10 UTC
Message-ID
<20171226091012.24315-5-pclouds@gmail.com>
In-Reply-To
<20171226091012.24315-1-pclouds@gmail.com>

We are about to adding support for "diff-files" rename, which has its own rename score in addition to the "diff-index" one. Rename score to head_score to indicate this score comes from diff-index. The new score will be named worktree_score.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 wt-status.c | 4 ++--
 wt-status.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index db06fc7c85..0f089c5789 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -532,7 +532,7 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
 		case DIFF_STATUS_COPIED:
 		case DIFF_STATUS_RENAMED:
 			d->head_path = xstrdup(p->one->path);
-			d->score = p->score * 100 / MAX_SCORE;
+			d->head_score = p->score * 100 / MAX_SCORE;
 			/* fallthru */
 		case DIFF_STATUS_MODIFIED:
 		case DIFF_STATUS_TYPE_CHANGED:
@@ -2074,7 +2074,7 @@ static void wt_porcelain_v2_print_changed_entry(
 				key, submodule_token,
 				d->mode_head, d->mode_index, d->mode_worktree,
 				oid_to_hex(&d->oid_head), oid_to_hex(&d->oid_index),
-				key[0], d->score,
+				key[0], d->head_score,
 				path_index, sep_char, path_head, eol_char);
 	else
 		fprintf(s->fp, "1 %s %s %06o %06o %06o %s %s %s%c",
diff --git a/wt-status.h b/wt-status.h
index fe27b465e2..f9330982ac 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -44,7 +44,7 @@ struct wt_status_change_data {
 	int worktree_status;
 	int index_status;
 	int stagemask;
-	int score;
+	int head_score;
 	int mode_head, mode_index, mode_worktree;
 	struct object_id oid_head, oid_index;
 	char *head_path;
-- 
2.15.0.320.g0453912d77
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 17 of 37 in “[BUG] File move with `add -N` shows as rename to same name”
  1. Alex VandiverDec 23, 2017
  2. Duy NguyenDec 25, 2017
  3. status: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 25, 2017
  4. Igor DjordjevicDec 25, 2017
  5. Igor DjordjevicDec 25, 2017
  6. Igor DjordjevicDec 25, 2017
  7. Duy NguyenDec 26, 2017
  8. Duy NguyenDec 26, 2017
  9. Junio C HamanoDec 27, 2017
  10. Junio C HamanoDec 27, 2017
  11. Jeff HostetlerJan 2, 2018
  12. Duy NguyenJan 10, 2018
  13. 0/7 Renames in git-status "changed not staged" sectionNguyễn Thái Ngọc Duy, Dec 26, 2017
  14. 1/7 t2203: test status output with porcelain v2 formatNguyễn Thái Ngọc Duy, Dec 26, 2017
  15. 2/7 Use DIFF_DETECT_RENAME for detect_rename assignmentsNguyễn Thái Ngọc Duy, Dec 26, 2017
  16. 3/7 wt-status.c: coding style fixNguyễn Thái Ngọc Duy, Dec 26, 2017
  17. 4/7 wt-status.c: rename wt_status_change_data::scoreNguyễn Thái Ngọc Duy, Dec 26, 2017
  18. 5/7 wt-status.c: catch unhandled diff status codesNguyễn Thái Ngọc Duy, Dec 26, 2017
  19. 6/7 wt-status.c: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 26, 2017
  20. Igor DjordjevicDec 26, 2017
  21. Duy NguyenDec 27, 2017
  22. Igor DjordjevicDec 28, 2017
  23. Igor DjordjevicDec 28, 2017
  24. 7/7 wt-status.c: avoid double renames in short/porcelain formatNguyễn Thái Ngọc Duy, Dec 26, 2017
  25. Igor DjordjevicDec 26, 2017
  26. Duy NguyenDec 27, 2017
  27. Igor DjordjevicDec 27, 2017
  28. 0/6 Renames in git-status "changed not staged" sectionNguyễn Thái Ngọc Duy, Dec 27, 2017
  29. 1/6 t2203: test status output with porcelain v2 formatNguyễn Thái Ngọc Duy, Dec 27, 2017
  30. 2/6 Use DIFF_DETECT_RENAME for detect_rename assignmentsNguyễn Thái Ngọc Duy, Dec 27, 2017
  31. 3/6 wt-status.c: coding style fixNguyễn Thái Ngọc Duy, Dec 27, 2017
  32. 4/6 wt-status.c: catch unhandled diff status codesNguyễn Thái Ngọc Duy, Dec 27, 2017
  33. 5/6 wt-status.c: rename rename-related fields in wt_status_change_dataNguyễn Thái Ngọc Duy, Dec 27, 2017
  34. 6/6 wt-status.c: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 27, 2017
  35. Igor DjordjevicDec 28, 2017
  36. Jeff HostetlerJan 2, 2018
  37. Torsten BögershausenDec 26, 2017

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.