* [PATCH] git-format-patch -3
@ 2007-01-17 21:35 Junio C Hamano
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
2007-01-18 1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin
0 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2007-01-17 21:35 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin
This teaches "git-format-patch" to honor the --max-count
parameter revision traversal machinery takes, so that you can
say "git-format-patch -3" to process the three topmost commits
from the current HEAD (or "git-format-patch -2 topic" to name a
specific branch).
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
* I think this is incompatible with --ignore-if-upstream, which
I haven't bothered to look into yet.
Likes, dislikes?
builtin-log.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 1cd9d3f..9453e6d 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -482,8 +482,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
}
if (rev.pending.nr == 1) {
- rev.pending.objects[0].item->flags |= UNINTERESTING;
- add_head(&rev);
+ if (rev.max_count < 0) {
+ rev.pending.objects[0].item->flags |= UNINTERESTING;
+ add_head(&rev);
+ }
+ /* Otherwise, it is "format-patch -22 HEAD", and
+ * get_revision() would return only the specified count.
+ */
}
if (ignore_if_in_upstream)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] Add --summary to git-format-patch by default
2007-01-17 21:35 [PATCH] git-format-patch -3 Junio C Hamano
@ 2007-01-17 21:51 ` Junio C Hamano
2007-01-17 22:41 ` [PATCH] git-format-patch: make --binary on " Junio C Hamano
2007-01-18 1:04 ` [PATCH] Add --summary to git-format-patch by default Shawn O. Pearce
2007-01-18 1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin
1 sibling, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2007-01-17 21:51 UTC (permalink / raw)
To: git
This adds --summary output in addition to the --stat to the
output from git-format-patch by default.
I think additions, removals and filemode changes are rare but
notable events and always showing it makes sense.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
* An alternative would be to give --summary whenever --stat is
asked for _any_ diff family of commands, which might make
sense but I suspect is going too far. At least format-patch
is a good place to add this since it allows accidental mode
changes to be caught at the last minute before sending the
message out to the public.
Opinions?
diff --git a/builtin-log.c b/builtin-log.c
index 9453e6d..c32a1df 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -468,7 +468,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
die ("unrecognized argument: %s", argv[1]);
if (!rev.diffopt.output_format)
- rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
+ rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
if (!output_directory)
output_directory = prefix;
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
index b4745e1..e5ddd6f 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
@@ -19,6 +19,7 @@ This is the second commit.
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
@@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit
dir/sub | 2 ++
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
@@ -126,6 +128,7 @@ Content-Transfer-Encoding: 8bit
file0 | 3 +++
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
index a9d1cd3..d0dd19b 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
@@ -19,6 +19,7 @@ This is the second commit.
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
@@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit
dir/sub | 2 ++
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
index 57b9d0b..67a95c5 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
@@ -17,6 +17,7 @@ Content-Transfer-Encoding: 8bit
file0 | 3 +++
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master
index c33302e..8b88ca4 100644
--- a/t/t4013/diff.format-patch_--stdout_initial..master
+++ b/t/t4013/diff.format-patch_--stdout_initial..master
@@ -10,6 +10,7 @@ This is the second commit.
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
@@ -53,6 +54,7 @@ Subject: [PATCH] Third
dir/sub | 2 ++
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
@@ -87,6 +89,7 @@ Subject: [PATCH] Side
file0 | 3 +++
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
diff --git a/dir/sub b/dir/sub
index 35d242b..7289e35 100644
diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^
index 03d0f96..47a4b88 100644
--- a/t/t4013/diff.format-patch_--stdout_initial..master^
+++ b/t/t4013/diff.format-patch_--stdout_initial..master^
@@ -10,6 +10,7 @@ This is the second commit.
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
@@ -53,6 +54,7 @@ Subject: [PATCH] Third
dir/sub | 2 ++
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
diff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side
index d10a465..e765088 100644
--- a/t/t4013/diff.format-patch_--stdout_initial..side
+++ b/t/t4013/diff.format-patch_--stdout_initial..side
@@ -9,6 +9,7 @@ Subject: [PATCH] Side
file0 | 3 +++
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
diff --git a/dir/sub b/dir/sub
index 35d242b..7289e35 100644
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] git-format-patch: make --binary on by default
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
@ 2007-01-17 22:41 ` Junio C Hamano
2007-01-17 23:06 ` [PATCH - todo] Changes to e-mailed patch handling in v1.5.0 Junio C Hamano
2007-01-18 1:04 ` [PATCH] Add --summary to git-format-patch by default Shawn O. Pearce
1 sibling, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2007-01-17 22:41 UTC (permalink / raw)
To: git
It does not make much sense to generate a patch that cannot be
applied. If --text is specified on the command line it still
takes precedence.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
* I would opt not to make "git am --binary" the default for
now. Even with this change, sending binary patch over e-mail
is unusual as it is harder to review --- I think it makes
sense to error out by default and draw attention from the
person who is applying the patch rather than accepting binary
patch automatically as if nothing unusual happened.
builtin-log.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index c32a1df..930cc04 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -470,6 +470,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (!rev.diffopt.output_format)
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
+ if (!rev.diffopt.text)
+ rev.diffopt.binary = 1;
+
if (!output_directory)
output_directory = prefix;
--
1.5.0.rc1.gde38
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH - todo] Changes to e-mailed patch handling in v1.5.0
2007-01-17 22:41 ` [PATCH] git-format-patch: make --binary on " Junio C Hamano
@ 2007-01-17 23:06 ` Junio C Hamano
2007-01-18 8:18 ` Andy Parkins
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2007-01-17 23:06 UTC (permalink / raw)
To: git
This applies to the draft v1.5.0 release notes in 'todo' branch and
summarizes the changes my patches to format-patch bring in.
I am neutral about changing the default suffix from .txt to .patch;
comments?
diff --git a/v1.5.0.txt b/v1.5.0.txt
index 2fccf8e..6a9a8d6 100644
--- a/v1.5.0.txt
+++ b/v1.5.0.txt
@@ -268,6 +268,21 @@ Updates in v1.5.0 since v1.4.4 series
excuse us for this very minor one-time inconvenience.
+* e-mailed patches
+
+ - See the above I18n section.
+
+ - git-format-patch now enables --binary without being asked.
+ git-am does _not_ default to it, as sending binary patch via
+ e-mail is unusual and is harder to review than textual
+ patches and it is prudent to require the person who is
+ applying the patch to explicitly ask for it.
+
+ - The default suffix for git-format-patch output is now ".patch",
+ not ".txt". This can be changed with --suffix=.txt option,
+ or "format.suffix = .txt" in the configuration.
+
+
* Foreign SCM interfaces
- git-svn now requires the Perl SVN:: libraries, the
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Add --summary to git-format-patch by default
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
2007-01-17 22:41 ` [PATCH] git-format-patch: make --binary on " Junio C Hamano
@ 2007-01-18 1:04 ` Shawn O. Pearce
1 sibling, 0 replies; 8+ messages in thread
From: Shawn O. Pearce @ 2007-01-18 1:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano <junkio@cox.net> wrote:
> This adds --summary output in addition to the --stat to the
> output from git-format-patch by default.
> Opinions?
This is the right thing to do. format-patch should default to
both --summary and --stat.
--
Shawn.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] git-format-patch -3
2007-01-17 21:35 [PATCH] git-format-patch -3 Junio C Hamano
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
@ 2007-01-18 1:25 ` Johannes Schindelin
1 sibling, 0 replies; 8+ messages in thread
From: Johannes Schindelin @ 2007-01-18 1:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Hi,
On Wed, 17 Jan 2007, Junio C Hamano wrote:
> * I think this is incompatible with --ignore-if-upstream, which
> I haven't bothered to look into yet.
Uhm. What exactly _would_ be upstream?
At the moment, for "--ignore-if-in-upstream" we handle _only_ ranges
(a..b), where we treat the left part as the upstream, so we first parse
all the diffs in b..a, and then ignore all commits in a..b which have an
already-seen diff hash.
However, if we want to do the logical analogue with "-22 HEAD", the
equivalent to b..a would trivially contain no commits at all.
> Likes, dislikes?
It sure is supported by the principle of least surprise.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH - todo] Changes to e-mailed patch handling in v1.5.0
2007-01-17 23:06 ` [PATCH - todo] Changes to e-mailed patch handling in v1.5.0 Junio C Hamano
@ 2007-01-18 8:18 ` Andy Parkins
2007-01-18 15:13 ` Brian Gernhardt
0 siblings, 1 reply; 8+ messages in thread
From: Andy Parkins @ 2007-01-18 8:18 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
On Wednesday 2007 January 17 23:06, Junio C Hamano wrote:
> I am neutral about changing the default suffix from .txt to .patch;
> comments?
I'm in favour. The extension indicates file type, and gives guidance on the
tool that can read it. Though .patch is stored in text it's more than that
(c.f. .html) - the text inside it has meaning beyond just the text.
To me, .txt would implies that the file format is in human-language format
(i.e. words, sentences, and paragraphs).
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH - todo] Changes to e-mailed patch handling in v1.5.0
2007-01-18 8:18 ` Andy Parkins
@ 2007-01-18 15:13 ` Brian Gernhardt
0 siblings, 0 replies; 8+ messages in thread
From: Brian Gernhardt @ 2007-01-18 15:13 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Junio C Hamano
On Jan 18, 2007, at 3:18 AM, Andy Parkins wrote:
> On Wednesday 2007 January 17 23:06, Junio C Hamano wrote:
>
>> I am neutral about changing the default suffix from .txt to .patch;
>> comments?
>
> I'm in favour. The extension indicates file type, and gives
> guidance on the
> tool that can read it. Though .patch is stored in text it's more
> than that
> (c.f. .html) - the text inside it has meaning beyond just the text.
>
> To me, .txt would implies that the file format is in human-language
> format
> (i.e. words, sentences, and paragraphs).
Ditto.
Also, Vim nicely detects the From <SHA1> line at the top and thinks
that it's an mbox file. With the patch extension it ignores that and
gives me my diff coloring again.
~~ Brian
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-01-18 15:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-17 21:35 [PATCH] git-format-patch -3 Junio C Hamano
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
2007-01-17 22:41 ` [PATCH] git-format-patch: make --binary on " Junio C Hamano
2007-01-17 23:06 ` [PATCH - todo] Changes to e-mailed patch handling in v1.5.0 Junio C Hamano
2007-01-18 8:18 ` Andy Parkins
2007-01-18 15:13 ` Brian Gernhardt
2007-01-18 1:04 ` [PATCH] Add --summary to git-format-patch by default Shawn O. Pearce
2007-01-18 1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin
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).