Re: [PATCH] Introduce 'git-format-patch --suffix=patch'

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

Re: [PATCH] Introduce 'git-format-patch --suffix=patch'

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

Andy Whitcroft [off-list ref] writes:
quoted
-	strcpy(filename + len, ".txt");
+	sprintf(filename + len, ".%s", fmt_patch_suffix);
This doesn't give us any possibility of not having a suffix.  Can we not
include the . in the suffix here so that we can specify it as "".
I've considered it, but I do not think it is worth it.  

If we did so, the configuration would look like:

	[format]
		suffix = .txt

which has a certain "Huh?" factor, and more importantly, a
careless user would end up with a patchfile that is named:

	0001-Introduce-git-format-patch-suffix-patchtxt

which is I think much worse than not being able to say:

	0001-Introduce-git-format-patch-suffix-patch

But I do not care that much either way.

Re: [PATCH] Introduce 'git-format-patch --suffix=patch'

From: Brian Gernhardt <hidden>
Date: 2016-06-15 22:42:49

On Jan 17, 2007, at 2:27 PM, Junio C Hamano wrote:
Andy Whitcroft [off-list ref] writes:
quoted
quoted
-	strcpy(filename + len, ".txt");
+	sprintf(filename + len, ".%s", fmt_patch_suffix);
This doesn't give us any possibility of not having a suffix.  Can  
we not
include the . in the suffix here so that we can specify it as "".
I've considered it, but I do not think it is worth it.
I think that the best form of DWIM is that if the suffix is "", then  
you simply skip the entire sprintf.  Then any suffix has to have the  
'.', but no suffix doesn't have it.  Additional DWIMMmery could  
remove an initial '.' from the suffix so that users expecting it to  
be there don't get ".." in their file.

Patch (on top of yours) should follow shortly.

~~ Brian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help