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

Re: [PATCH 1/1] Add --first-parent support to interactive rebase.

From
Jeff King <peff@peff.net>
Date
Nov 1, 2007, 03:23 UTC
Message-ID
<20071101032303.GA14495@coredump.intra.peff.net>
In-Reply-To
<7vzlxygblz.fsf@gitster.siamese.dyndns.org>
On Wed, Oct 31, 2007 at 03:31:20PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> > ... I had one concern that
> > I was tracking down: is the author name encoding necessarily the same as
> > the commit text encoding?
> 
> The user is screwing himself already if that is the case and
> uses -s to format-patch, isn't he?

Hrm, they probably _should_ be the same in the output. It's not clear to me what encoding we assume the name comes in (utf-8, I guess). Looks like we don't touch it at all when putting it in the signoff. I think we should just be able to reencode when appending the signoff; patch is below.

I'm sure there are other weird interactions lurking. For example, do we correctly detect an existing signoff if we are storing in a non-utf8 encoding? I must admit to being a little ignorant to some of the encoding magic of git, having a us-ascii name myself.

---
diff --git a/log-tree.c b/log-tree.c
index 3763ce9..906942d 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -3,6 +3,7 @@
 #include "commit.h"
 #include "log-tree.h"
 #include "reflog-walk.h"
+#include "utf8.h"
 
 struct decoration name_decoration = { "object names" };
 
@@ -111,7 +112,14 @@ static void append_signoff(struct strbuf *sb, const char *signoff)
 		strbuf_addch(sb, '\n');
 
 	strbuf_addstr(sb, signed_off_by);
-	strbuf_add(sb, signoff, signoff_len);
+	if (git_log_output_encoding) {
+		char *encoded_name = reencode_string(signoff,
+				git_log_output_encoding, "utf-8");
+		strbuf_addstr(sb, encoded_name);
+		free(encoded_name);
+	}
+	else
+		strbuf_add(sb, signoff, signoff_len);
 	strbuf_addch(sb, '\n');
 }
 
Previous: Junio C HamanoNext: Junio C Hamano
Message 16 of 18 in “Add --first-parent support to interactive rebase.”
  1. 1/1 Add --first-parent support to interactive rebase.Björn Steinbrink, Oct 31, 2007
  2. Johannes SchindelinOct 31, 2007
  3. Björn SteinbrinkOct 31, 2007
  4. Johannes SchindelinOct 31, 2007
  5. Wincent ColaiutaOct 31, 2007
  6. Junio C HamanoOct 31, 2007
  7. Björn SteinbrinkOct 31, 2007
  8. Dmitry PotapovOct 31, 2007
  9. Karl HasselströmOct 31, 2007
  10. Dmitry PotapovOct 31, 2007
  11. Jeff KingOct 31, 2007
  12. Björn SteinbrinkOct 31, 2007
  13. Junio C HamanoOct 31, 2007
  14. Jeff KingOct 31, 2007
  15. Junio C HamanoOct 31, 2007
  16. Jeff KingNov 1, 2007
  17. Junio C HamanoNov 1, 2007
  18. Jeff KingNov 1, 2007

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.