Re: [PATCH 3/6] branch: teach --edit-description option

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 3/6] branch: teach --edit-description option

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:06

Nguyen Thai Ngoc Duy [off-list ref] writes:
On Thu, Sep 22, 2011 at 03:09:19PM -0700, Junio C Hamano wrote:
quoted
+	if (launch_editor(git_path(edit_description), &buf, NULL)) {
+		strbuf_release(&buf);
+		return -1;
+	}
+	stripspace(&buf, 1);
+
+	strbuf_addf(&name, "branch.%s.description", branch_name);
+	status = git_config_set(name.buf, buf.buf);
I suppose a Windows editor mave save the description with \r\n
ending. Perhaps a patch like this to avoid messing up config file?
Doesn't stripspace() cleanse that already?

Re: [PATCH 3/6] branch: teach --edit-description option

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:52:06

On Sat, Sep 24, 2011 at 5:04 AM, Junio C Hamano [off-list ref] wrote:
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
On Thu, Sep 22, 2011 at 03:09:19PM -0700, Junio C Hamano wrote:
quoted
+    if (launch_editor(git_path(edit_description), &buf, NULL)) {
+            strbuf_release(&buf);
+            return -1;
+    }
+    stripspace(&buf, 1);
+
+    strbuf_addf(&name, "branch.%s.description", branch_name);
+    status = git_config_set(name.buf, buf.buf);
I suppose a Windows editor mave save the description with \r\n
ending. Perhaps a patch like this to avoid messing up config file?
Doesn't stripspace() cleanse that already?
Yes, isspace() indeed treats \r as a space and stripspace() does the
right thing.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help