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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 31, 2007 at 03:31:20PM -0700, Junio C Hamano wrote:

> > ... 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');
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux