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

[PATCHv2] log: Do not decorate replacements with --no-replace-objects

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Aug 25, 2011, 15:09 UTC
Message-ID
<739ff64bdbd0c099b3baf0755c0350de82c1ec0a.1314284204.git.git@drmicha.warpmail.net>
In-Reply-To
<4E566586.5010901@drmicha.warpmail.net>

5267d29 (log: decorate "replaced" on to replaced commits, 2011-08-19) introduced textual decorations for replaced commits, based on the detection of refs/replace.

Make it so that additionally the use of --no-replace-objects is detected: I.e. replaced commits are only decorated as replaced when they are actually replaced.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Sorry for being late to the party. Trying to keep up.
---
 log-tree.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/log-tree.c b/log-tree.c
index 74fc20d..f65f6b6 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -96,6 +96,8 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
 	enum decoration_type type = DECORATION_NONE;
 
 	if (!prefixcmp(refname, "refs/replace/")) {
+		if (!read_replace_refs)
+			return 0;
 		unsigned char original_sha1[20];
 		if (get_sha1_hex(refname + 13, original_sha1)) {
 			warning("invalid replace ref %s", refname);
-- 
1.7.6.845.gc3c05
Previous: Michael J GruberNext: Junio C Hamano
Message 4 of 5 in “log: Do not decorate replacements with --no-replace-objects”
  1. log: Do not decorate replacements with --no-replace-objectsMichael J Gruber, Aug 25, 2011
  2. Nguyen Thai Ngoc DuyAug 25, 2011
  3. Michael J GruberAug 25, 2011
  4. [PATCHv2] log: Do not decorate replacements with --no-replace-objectsMichael J Gruber, Aug 25, 2011
  5. Junio C HamanoAug 25, 2011

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.