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

[PATCH/POLL] git-format-patch: the default suffix is now .patch, not .txt

From
Junio C Hamano <junkio@cox.net>
Date
Jan 18, 2007, 00:06 UTC
Message-ID
<7vd55dp5a3.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vsle9p8pg.fsf@assigned-by-dhcp.cox.net>

Editors often give easier handling of patch files if the filename ends with .patch, so use it instead of .txt.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
  Junio C Hamano <junkio@cox.net> writes:
  > "Josh Boyer" <jwboyer@gmail.com> writes:
  >
  >> On 1/17/07, Junio C Hamano <junkio@cox.net> wrote:
  >>
  >>> Two minor objections to changing the default are: (1) it's a
  >>> change and any change is bad ;-) and (2) the reason I changed it
  >>> to .txt before submitting the original format-patch to Linus was
  >>> because Emacs wanted to go into its "diff" mode when files are
  >>> named with .patch suffix, which had two annoyances (read-only by
  >>> default, and editing patch tried to automatically recount diff
  >>> and its recounting screwed up in some cases I do not remember
  >>> the details about).
  >>
  >> Well there's your problem.  You're using Emacs.  ;)
  >
  > Fair enough.  Its probably that there is something wrong in the
  > way I am using Emacs diff/patch editing mode.  Even if the
  > problem I had were because of bugs in Emacs, the users of git
  > should not have to suffer from "unusual" suffixes to work them
  > around.
  >
  > So that lifts one of the objections.  What should be done to the
  > other one --- time for a quick poll?
 Documentation/git-format-patch.txt                 |   15 +++++++--------
 .../howto/rebase-from-internal-branch.txt          |    2 +-
 builtin-log.c                                      |    2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index c0ffe99..49f51bb 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -79,9 +79,9 @@ OPTIONS
 	provide a new patch series.
 
 --suffix=.<sfx>::
-	Instead of using `.txt` as the suffix for generated
+	Instead of using `.patch` as the suffix for generated
 	filenames, use specifed suffix.  A common alternative is
-	`--suffix=.patch`.
+	`--suffix=.txt`.
 +
 Note that you would need to include the leading dot `.` if you
 want a filename like `0001-description-of-my-change.patch`, and
@@ -91,15 +91,14 @@ not add any suffix.
 CONFIGURATION
 -------------
 You can specify extra mail header lines to be added to each
-message in the repository configuration as follows:
+message in the repository configuration.  Also you can specify
+the default suffix different from the built-in one:
 
+------------
 [format]
         headers = "Organization: git-foo\n"
-
-You can specify default suffix used:
-
-[format]
-        suffix = .patch
+        suffix = .txt
+------------
 
 
 EXAMPLES
diff --git a/Documentation/howto/rebase-from-internal-branch.txt b/Documentation/howto/rebase-from-internal-branch.txt
index fcd64e9..3b3a5c2 100644
--- a/Documentation/howto/rebase-from-internal-branch.txt
+++ b/Documentation/howto/rebase-from-internal-branch.txt
@@ -106,7 +106,7 @@ prepare #2 and #3 for e-mail submission.
 
     $ git format-patch master^^ master
 
-This creates two files, 0001-XXXX.txt and 0002-XXXX.txt.  Send
+This creates two files, 0001-XXXX.patch and 0002-XXXX.patch.  Send
 them out "To: " your project maintainer and "Cc: " your mailing
 list.  You could use contributed script git-send-email if
 your host has necessary perl modules for this, but your usual
diff --git a/builtin-log.c b/builtin-log.c
index 930cc04..f3cff13 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -197,7 +197,7 @@ static int istitlechar(char c)
 
 static char *extra_headers = NULL;
 static int extra_headers_size = 0;
-static const char *fmt_patch_suffix = ".txt";
+static const char *fmt_patch_suffix = ".patch";
 
 static int git_format_config(const char *var, const char *value)
 {
-- 
1.5.0.rc1.gde38
Previous: Josh BoyerNext: Johannes Schindelin
Message 20 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.