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

Re: [RFC] Add a suffix option to git-format-patch

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 17, 2007, 13:49 UTC
Message-ID
<Pine.LNX.4.63.0701171446410.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<625fc13d0701170510x8883539g93f43d9ddffe56f0@mail.gmail.com>
Hi,
On Wed, 17 Jan 2007, Josh Boyer wrote:
Show 13 quoted lines
> Could we add an option to git-format-patch to use ".patch" as the file
> suffix instead of ".txt"?  Something like the below?
> 
> diff --git a/builtin-log.c b/builtin-log.c
> index a59b4ac..4eb2d32 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -217,6 +217,7 @@ static int git_format_config(const char *var,
> const char *value)
> 
> static FILE *realstdout = NULL;
> static const char *output_directory = NULL;
> +static int psuffix = 0;
Why not
	static const char *file_extension = ".txt"
Hmm?
> 	}
> -	strcpy(filename + len, ".txt");
Here, you would write
	strcpy(filename + len, file_extension);
Show 7 quoted lines
> @@ -436,6 +441,8 @@ int cmd_format_patch(int argc, const char **argv,
> const char *prefix)
> 				die("Need a Message-Id for --in-reply-to");
> 			in_reply_to = argv[i];
> 		}
> +		else if (!strcmp(argv[i], "--psuffix"))
> +			psuffix = 1;
and here:
		else if (!strncmp(argv[i], "--extension=", 12))
			file_extension = argv[i] + 12;

You'd call it with "--extension=.patch", and if you really want, you can make a config variable from it.

Ciao, Dscho

Previous: Josh BoyerNext: Josh Boyer
Message 2 of 59 in “[RFC] Add a suffix option to git-format-patch”
  1. Josh BoyerJan 17, 2007
  2. Johannes SchindelinJan 17, 2007
  3. Josh BoyerJan 17, 2007
  4. Horst H. von BrandJan 17, 2007
  5. Introduce 'git-format-patch --suffix=patch'Junio C Hamano, Jan 17, 2007
  6. Andy WhitcroftJan 17, 2007
  7. Junio C HamanoJan 17, 2007
  8. Brian GernhardtJan 17, 2007
  9. Junio C HamanoJan 17, 2007
  10. Brian GernhardtJan 17, 2007
  11. Make format-patch --suffix="" not add any suffixBrian Gernhardt, Jan 17, 2007
  12. Johannes SchindelinJan 18, 2007
  13. David KågedalJan 17, 2007
  14. Andreas EricssonJan 17, 2007
  15. Johannes SchindelinJan 17, 2007
  16. Junio C HamanoJan 17, 2007
  17. David KågedalJan 17, 2007
  18. Josh BoyerJan 17, 2007
  19. Josh BoyerJan 17, 2007
  20. git-format-patch: the default suffix is now .patch, not .txtJunio C Hamano, Jan 18, 2007
  21. Johannes SchindelinJan 18, 2007
  22. Alex RiesenJan 18, 2007
  23. Shawn O. PearceJan 18, 2007
  24. Alex RiesenJan 18, 2007
  25. Junio C HamanoJan 18, 2007
  26. Alex RiesenJan 18, 2007
  27. Junio C HamanoJan 18, 2007
  28. Alex RiesenJan 18, 2007
  29. Josh BoyerJan 18, 2007
  30. Johannes SchindelinJan 18, 2007
  31. Alex RiesenJan 18, 2007
  32. Alex RiesenJan 18, 2007
  33. Andreas EricssonJan 18, 2007
  34. Johannes SchindelinJan 18, 2007
  35. Alex RiesenJan 18, 2007
  36. Johannes SchindelinJan 18, 2007
  37. Alex RiesenJan 18, 2007
  38. Johannes SchindelinJan 18, 2007
  39. Alex RiesenJan 18, 2007
  40. Josh BoyerJan 18, 2007
  41. Johannes SchindelinJan 18, 2007
  42. Josh BoyerJan 18, 2007
  43. Shawn O. PearceJan 18, 2007
  44. Alex RiesenJan 18, 2007
  45. Steven GrimmJan 18, 2007
  46. Johannes SchindelinJan 18, 2007
  47. Johannes SixtJan 18, 2007
  48. Jakub NarebskiJan 19, 2007
  49. Shawn O. PearceJan 18, 2007
  50. Alex RiesenJan 18, 2007
  51. Andreas EricssonJan 18, 2007
  52. Shawn O. PearceJan 18, 2007
  53. Andreas EricssonJan 18, 2007
  54. Martin LanghoffJan 18, 2007
  55. Martin LanghoffJan 18, 2007
  56. Andreas EricssonJan 18, 2007
  57. Lukas SandströmJan 18, 2007
  58. Brian GernhardtJan 18, 2007
  59. Alexandre JulliardJan 18, 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.