From: Jens Lehmann <Jens.Lehmann@web.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Junio C Hamano <gitster@pobox.com>,
Lars Hjemli <hjemli@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add the --submodule-summary option to the diff option family
Date: Mon, 05 Oct 2009 13:22:19 +0200 [thread overview]
Message-ID: <4AC9D6EB.8090002@web.de> (raw)
In-Reply-To: <alpine.DEB.1.00.0910051027010.4985@pacific.mpi-cbg.de>
First: I already coded a test and am using this patch in git gui and
gitk (there was no way git submodule summary would have worked for
gitk, now it does). Looking really good, will post when this patch
solidifies ...
Johannes Schindelin schrieb:
> That's something I will gladly do after I adjusted the format to look a
> bit more like "git submodule summary" (Jens noticed 4 differences), and
> after Jens patched git-submodule.sh to use the diff mode instead.
Actually there are two more and Junio pointed out #7: submodule summary
uses --first-parent and we don't (My testcases don't contain merges, so
i didn't notice).
The difference that is most obvious and was unintended is that the
shortlog is indented by four spaces instead of two. I appended an
interdiff to fix that.
As with the other six, i am not really sure if we should just copy the
behaviour of git submodule summary.
> IOW in hindsight I would like to add the prefix "RFC/RFH" to the subject.
FullAck.
First some examples for the current behaviour (with the patch below
applied):
$ git diff --submodule-summary
Submodule sub 5431f52..3f35670:
> sub3
$ git submodule summary --files
* sub 5431f52...3f35670 (1):
> sub3
$ git diff-index --submodule-summary HEAD -p
Submodule sub 81d7059..3f35670:
> sub3
> sub2
$ git submodule summary
* sub 81d7059...3f35670 (2):
> sub3
> sub2
[$ git diff --cached --submodule-summary HEAD
Submodule sub 81d7059..5431f52:
> sub2
$ git submodule summary --cached
* sub 81d7059...5431f52 (1):
> sub2
$
So the differences are:
1) Dscho replaced the leading '*' with the more explicit "Submodule"
I like the explicit version.
2) submodule summary prints out how many shortlog entries are following
3) submodule summary adds a newline after the shortlog
4) submodule summary uses --first-parent
No idea about the intention here. Lars?
5) submodule summary always prints three '.' between the hashes
Seems like submodule summary didn't do the hassle for performance
reasons. But for consistency i would prefer the new version as we
use it all over the place, no?
6) submodule summary can limit the number of shortlog lines
Hm, i want to see them all. Any users of that -n option?
To take this a bit further: It might be a good idea to let git diff
generate output for submodules that is consistent with that for regular
files. So instead of:
git diff --cached --submodule-summary HEAD -p
Submodule sub 81d7059..5431f52:
> sub2
we could produce:
diff --git a/sub b/sub
index 81d7059..3f35670 160000
--- a/sub
+++ b/sub
@@ -1 +1 @@
-Subproject commit 81d70590e6aaf9f995ebf4d6d284a7ebb355398d
+Subproject commit 3f356705649b5d566d97ff843cf193359229a453
> sub2
(This is the output of a git diff without the --submodule-summary option
with an appended shortlog)
I like the second variant (mainly because of consistency). Opinions?
And here the promised indentation depth fix interdiff:
------------------8<-----------------
diff --git a/submodule.c b/submodule.c
index 3f2590d..11fce7d 100644
--- a/submodule.c
+++ b/submodule.c
@@ -42,7 +42,7 @@ void show_submodule_summary(FILE *f, const char *path,
struct commit_list *merge_bases, *list;
const char *message = NULL;
struct strbuf sb = STRBUF_INIT;
- static const char *format = " %m %s";
+ static const char *format = " %m %s";
int fast_forward = 0, fast_backward = 0;
if (add_submodule_odb(path))
next prev parent reply other threads:[~2009-10-05 11:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1254668669u.git.johannes.schindelin@gmx.de>
2009-10-04 15:05 ` [PATCH] Add the --submodule-summary option to the diff option family Johannes Schindelin
2009-10-04 22:19 ` Junio C Hamano
2009-10-05 6:18 ` Johannes Sixt
2009-10-05 9:00 ` Johannes Schindelin
2009-10-05 9:09 ` Johannes Sixt
2009-10-05 9:20 ` Johannes Schindelin
[not found] ` <alpine.DEB.1.00.0910051027010.4985@pacific.mpi-cbg.de>
2009-10-05 9:21 ` Johannes Schindelin
2009-10-05 11:22 ` Jens Lehmann [this message]
2009-10-05 17:32 ` Jens Lehmann
2009-10-05 20:39 ` Johannes Schindelin
2009-10-05 19:08 ` Junio C Hamano
2009-10-05 21:08 ` Johannes Schindelin
2009-10-06 10:58 ` Jens Lehmann
2009-10-06 11:36 ` Junio C Hamano
2009-10-06 11:45 ` Johannes Schindelin
2009-10-06 11:51 ` Jens Lehmann
2009-10-06 12:10 ` Johannes Schindelin
2009-10-07 19:32 ` Jens Lehmann
2009-10-07 20:00 ` Junio C Hamano
2009-10-07 22:28 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AC9D6EB.8090002@web.de \
--to=jens.lehmann@web.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hjemli@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).