From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Dmitry Potapov" <dpotapov@gmail.com>,
"Karl Hasselström" <kha@treskal.com>,
"Björn Steinbrink" <B.Steinbrink@gmx.de>,
Johannes.Schindelin@gmx.de, git@vger.kernel.org
Subject: Re: [PATCH 1/1] Add --first-parent support to interactive rebase.
Date: Wed, 31 Oct 2007 23:23:03 -0400 [thread overview]
Message-ID: <20071101032303.GA14495@coredump.intra.peff.net> (raw)
In-Reply-To: <7vzlxygblz.fsf@gitster.siamese.dyndns.org>
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');
}
next prev parent reply other threads:[~2007-11-01 3:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 2:21 [PATCH 1/1] Add --first-parent support to interactive rebase Björn Steinbrink
2007-10-31 3:34 ` Johannes Schindelin
2007-10-31 4:17 ` Björn Steinbrink
2007-10-31 4:50 ` Johannes Schindelin
2007-10-31 8:24 ` Wincent Colaiuta
2007-10-31 5:05 ` Junio C Hamano
2007-10-31 5:53 ` Björn Steinbrink
2007-10-31 13:43 ` Dmitry Potapov
2007-10-31 14:00 ` Karl Hasselström
2007-10-31 14:36 ` Dmitry Potapov
2007-10-31 18:05 ` Jeff King
2007-10-31 19:50 ` Björn Steinbrink
2007-10-31 21:53 ` Junio C Hamano
2007-10-31 21:56 ` Jeff King
2007-10-31 22:31 ` Junio C Hamano
2007-11-01 3:23 ` Jeff King [this message]
2007-11-01 4:10 ` Junio C Hamano
2007-11-01 4:14 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071101032303.GA14495@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=B.Steinbrink@gmx.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kha@treskal.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).