* Re: Re-casing directories on case-insensitive systems
From: David Kastrup @ 2008-01-12 12:07 UTC (permalink / raw)
To: Kevin Ballard; +Cc: Junio C Hamano, git
In-Reply-To: <08E42D03-7AAA-4ADD-9F5B-215AB30E34E1@sb.org>
Kevin Ballard <kevin@sb.org> writes:
> On Jan 11, 2008, at 8:30 PM, Junio C Hamano wrote:
>
>>> Apparently so. By Junio's definition, HFS+ is not a sane filesystem,
>>> and as git grows more popular with OS X users, this issue is going to
>>> crop up more frequently.
>>
>> It's not "my" definition, but you asked the reason and I gave
>> the answer. We can close this issue of "is HFS+ sane" now.
>> HFS+ is insane, period. And as Linus said, you cannot forgive
>> its insanity using the historical baggage argument, like MS-DOS.
>
> Fair enough, though I believe OS X has a good reason, namely it's an
> OS designed for regular users rather than servers or
> programmers. Case-sensitivity would confuse my mother.
If case-sensitivity would be the primary cause of confusion in
mother-computer interoperation, you have a remarkable mother.
"Type things the same way and they work the same" is a simple enough
rule.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply
* Re: valgrind test script integration
From: Jeff King @ 2008-01-12 11:36 UTC (permalink / raw)
To: git
In-Reply-To: <20080112111044.GA24257@coredump.intra.peff.net>
On Sat, Jan 12, 2008 at 06:10:44AM -0500, Jeff King wrote:
> - We only catch calls to 'git', not 'git-foo' (and in fact for that
> reason this doesn't catch the t7300 bug by itself, since that uses
> git-clean). A follow-on patch will deal with this.
And here it is.
This replaces all usage of "git-foo" with "git foo" in the
test scripts. The replacement was done semi-manually; a
fully automatic replacement won't work because the pattern
"git-" appears in several other contexts (e.g.,
"--git-dir=", ref names, filenames, etc).
Obviously another route would be intercepting git-* calls,
as well, but my impression is that we are ultimately heading
towards a "git foo is the right way" situation, in which
case this cleanup is eventually necessary anyway.
[the original got eaten by the list since the patch is almost 150K;
the diffstat is below, and I am making the patch available at
git://repo.or.cz/git/peff.git master
]
t/t1400-update-ref.sh | 10 +-
t/t2005-checkout-index-symlinks.sh | 4 +-
t/t2050-git-dir-relative.sh | 4 +-
t/t2102-update-index-symlinks.sh | 2 +-
t/t2200-add-update.sh | 12 +-
t/t3020-ls-files-error-unmatch.sh | 2 +-
t/t3030-merge-recursive.sh | 14 +-
t/t3200-branch.sh | 16 +-
t/t3210-pack-refs.sh | 4 +-
t/t3400-rebase.sh | 6 +-
t/t3401-rebase-partial.sh | 20 +-
t/t3500-cherry.sh | 12 +-
t/t3600-rm.sh | 4 +-
t/t3800-mktag.sh | 8 +-
t/t3900-i18n-commit.sh | 6 +-
t/t3901-i18n-patch.sh | 16 +-
t/t4012-diff-binary.sh | 2 +-
t/t4103-apply-binary.sh | 26 ++--
t/t5300-pack-object.sh | 14 +-
t/t5301-sliding-window.sh | 4 +-
t/t5302-pack-index.sh | 10 +-
t/t5400-send-pack.sh | 30 ++--
t/t5401-update-hooks.sh | 4 +-
t/t5402-post-merge-hook.sh | 4 +-
t/t5403-post-checkout-hook.sh | 4 +-
t/t5500-fetch-pack.sh | 4 +-
t/t5510-fetch.sh | 2 +-
t/t5530-upload-pack-error.sh | 4 +-
t/t5600-clone-fail-cleanup.sh | 6 +-
t/t6006-rev-list-format.sh | 6 +-
t/t6025-merge-symlinks.sh | 32 ++--
t/t6026-merge-attr.sh | 12 +-
t/t6030-bisect-porcelain.sh | 2 +-
t/t6120-describe.sh | 30 ++--
t/t6300-for-each-ref.sh | 28 ++--
t/t7001-mv.sh | 12 +-
t/t7003-filter-branch.sh | 18 +-
t/t7004-tag.sh | 316 ++++++++++++++++----------------
t/t7101-reset.sh | 6 +-
t/t7300-clean.sh | 38 ++--
t/t7400-submodule-basic.sh | 46 +++---
t/t7501-commit.sh | 44 +++---
t/t9100-git-svn-basic.sh | 44 +++---
t/t9101-git-svn-props.sh | 62 +++---
t/t9102-git-svn-deep-rmdir.sh | 6 +-
t/t9104-git-svn-follow-parent.sh | 36 ++--
t/t9105-git-svn-commit-diff.sh | 8 +-
t/t9106-git-svn-commit-diff-clobber.sh | 12 +-
t/t9107-git-svn-migrate.sh | 16 +-
t/t9108-git-svn-glob.sh | 4 +-
t/t9110-git-svn-use-svm-props.sh | 8 +-
t/t9111-git-svn-use-svnsync-props.sh | 8 +-
t/t9112-git-svn-md5less-file.sh | 4 +-
t/t9116-git-svn-log.sh | 4 +-
t/t9119-git-svn-info.sh | 120 ++++++------
t/t9200-git-cvsexportcommit.sh | 10 +-
t/t9300-fast-import.sh | 64 ++++----
t/t9400-git-cvsserver-server.sh | 30 ++--
58 files changed, 640 insertions(+), 640 deletions(-)
^ permalink raw reply
* Re: [PATCH 2/5] git-submodule: New subcommand 'summary' (2) - hard work
From: Ping Yin @ 2008-01-12 11:12 UTC (permalink / raw)
To: git; +Cc: gitster
In-Reply-To: <62a73e734832ad67e89be706f1f8b3dbc30cfcf4.1200122041.git.pkufranky@gmail.com>
> + echo "* $name $sha1_src...$sha1_dst:"
If it's a type change (head submodule but index blob, or the the
reverse), $sha1_dst or $sha1_src will be the sha1 of the blob. It's
inapprociate to be shown as if it's a commit in the submodule. May
00000000 should be shown instead of the blob sha1? However, any good
way to tell user the type change info? Is it ok to add an additional
line such as ""Add file sm1" in the summary and also change the
summary description as follows?
-------------------------------------------------------------------------------------
$ git submodule summary sm1
# Submodules modifiled: sm1
#
# * sm1 354cd45...0000000(3f751e5):
# <one line message for C
# <one line message for B
# >Add file sm1
-------------------------------------------------------------------------------------
> 1.5.4.rc2.9.gf5146-dirty
>
>
--
Ping Yin
^ permalink raw reply
* valgrind test script integration
From: Jeff King @ 2008-01-12 11:10 UTC (permalink / raw)
To: git
In-Reply-To: <20080112090432.GA6134@coredump.intra.peff.net>
On Sat, Jan 12, 2008 at 04:04:32AM -0500, Jeff King wrote:
> I couldn't reproduce this just running the test, but running it under
> valgrind showed a memory access error. Fix is below.
BTW, this could have been caught automagically if we had valgrind
integration in the test scripts. Below is a rudimentary patch to do so.
I'm not that familiar with valgrind, so input from those more
knowledgeable is appreciated, and maybe we can get something official
post-1.5.4.
You can use it like "./t7300-clean.sh -m"; each call to 'git' is run
through valgrind, and returns an error if the original program had an
error, or if valgrind turned up any errors.
It of course runs horribly slowly. I've just kicked off a
make GIT_TEST_OPTS='-i -m'
now. A few caveats:
- It barfs on _any_ valgrind error. On my Debian unstable system,
anything that touches nss ends up with an error deep in the dlopen
code. Therefore to make this useful, I had to put
{
dl hack
Memcheck:Addr4
obj:/lib/ld-2.7.so
}
into /usr/lib/valgrind/default.supp
We should maybe have a 'git.supp' error suppression file, but in this
case, the error really seems to be platform-specific.
- We only catch calls to 'git', not 'git-foo' (and in fact for that
reason this doesn't catch the t7300 bug by itself, since that uses
git-clean). A follow-on patch will deal with this.
---
t/test-lib.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 90b6844..415e918 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -84,6 +84,8 @@ do
--no-python)
# noop now...
shift ;;
+ -m|--m|--me|--mem|--memc|--memch|--memche|--memchec|--memcheck)
+ alias git='memcheck git'; shift ;;
*)
break ;;
esac
@@ -120,6 +122,12 @@ say () {
say_color info "$*"
}
+memcheck() {
+ valgrind -q --error-exitcode=1 --leak-check=no "$@" && return 0
+ echo >&2 valgrind failure: "$@"
+ return 1
+}
+
test "${test_description}" != "" ||
error "Test script did not set test_description."
--
1.5.4.rc3.1.g027628-dirty
^ permalink raw reply related
* Re: gitk dev branch: F5 problem again
From: Paul Mackerras @ 2008-01-12 10:55 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
In-Reply-To: <47876C69.8070604@viscovery.net>
Johannes Sixt writes:
> I'm using gitk's dev branch (476ca63d Index [fnvr]highlights by id...) on
> Windows.
>
> Start gitk like this:
>
> gitk somefile.c
>
> while on a branch whose tip touches somefile.c.
>
> Now:
>
> git commit --amend
>
> Then press F5 in gitk. I get these error reports after which gitk is
> unresponsive:
>
> can't read "children(1,)": no such element in array
Thanks.
I found the reason for the Tcl errors - an incorrect optimization in
make_disporder - and I have pushed out a fix.
However, that shows up another problem, due to the way parent
rewriting does (or doesn't) work when we are limiting both by
revisions and by path. When you press F5 in the above scenario, you
will get the new version of the commit, with its real parent shown as
an open-circle commit, disconnected from the rest of the graph.
What's happening here is that to do the update, gitk first re-reads
all the references, notices that the head has changed, and does a git
log command like:
git log newhead ^oldhead -- somefile.c
The git log traversal stops as soon as it finds a commit which is an
ancestor of oldhead, which in this case will be oldhead's (and
newhead's) real parent. Because the traversal doesn't go far enough
to find another commit that touches somefile.c (which would be the
fake parent that gitk would want to use for the graph), the parent
rewriting doesn't happen and git log outputs the newhead commit with
its real parent rather than a fake parent. Assuming the real parent
doesn't touch somefile.c, it is a commit that gitk doesn't have in its
graph, so it can't join newhead into the existing graph properly. I'm
not sure how best to fix that. I'll have to think about it.
Paul.
^ permalink raw reply
* Re: [PATCH] git-svn: handle leading/trailing whitespace from svnsync revprops
From: Björn Steinbrink @ 2008-01-12 9:55 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, Dennis Schridde, git
In-Reply-To: <20080112091242.GA27109@soma>
On 2008.01.12 01:12:42 -0800, Eric Wong wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > Is it only me who finds that
> >
> > ($var) = ($var =~ m{^(any regexp)$}) or die "message"
> >
> > is extremely a roundabout and hard-to-read way to say:
> >
> > if ($var !~ m{^(the same regexp)$} {
> > die "message";
> > }
> >
> > which is much easier to read?
>
> The statements are not equivalent, however. I'd have to add
>
> $var = $1;
>
> too, because I needed to extract what was inside the ( ) since the '$'
> doesn't catch the trailing newline, either. I also couldn't find any of
> the /sm, /m, /s switches useful for making '$' not accept the trailing
> newline, either.
The \z assertion will do, eg m/^foo\z/ will only match exactly "foo",
not "foo\n". As it is a zero-width assertion, you can also write
m/^foo\z$/ if you prefer that.
Björn
^ permalink raw reply
* Re: [PATCH 3/5] git-submodule: New subcommand 'summary' (3) - limit summary size
From: Ping Yin @ 2008-01-12 9:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vabnbv3sb.fsf@gitster.siamese.dyndns.org>
On Jan 12, 2008 4:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Ping Yin <pkufranky@gmail.com> writes:
>
> > @@ -265,6 +267,10 @@ set_name_rev () {
> > #
> > modules_summary()
> > {
> > + summary_limit=${summary_limit:-1000000}
>
> Why a million?
Because i think a million is big enough. I'd better define a constant
for unlimited number.
>
> > + summary_limit=$((summary_limit<0?1000000:summary_limit))
>
> This is doubly bashism. Variables must be referenced with $,
> and $(( conditional ? iftrue : iffalse )) is not POSIX.
>
Ok, i'll fix this.
--
Ping Yin
^ permalink raw reply
* Re: [PATCH 2/5] git-submodule: New subcommand 'summary' (2) - hard work
From: Ping Yin @ 2008-01-12 9:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejcnv3zk.fsf@gitster.siamese.dyndns.org>
On Jan 12, 2008 4:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Ping Yin <pkufranky@gmail.com> writes:
>
>
> > + check_dst=t
> > + check_src=t
> > + case $status in
> > + D)
> > + check_dst=
> > + ;;
> > + A)
> > + check_src=
> > + ;;
>
> I'd loosen the above grep (see my comments to your 1/5) and also
> add this:
>
> *)
> continue ;# punt
> ;;
>
> so that the rest of the code won't break when seeing a path that
> was submodule in the HEAD but is a blob in the index.
Right. I thought 'M' should be the default case because I missed the
case 'T' (head blob but index submodule, or the reverse) .
>
> > + esac
> > +
> > + (
> > + errmsg=
> > + unfound_src=
> > + unfound_dst=
> > +
> > + test -z "$check_src" ||
> > + GIT_DIR="$name/.git" git-rev-parse $sha1_src >&/dev/null ||
>
>
> I think you would want to read full 40-char sha1_src and
> sha1_dst with "while read", and keep that full 40-char in these
> variables, and use them when calling rev-parse here.
Hmm, precision is really a problem. However, "git diff --raw" will not
always give full 40-char sha1, instead it will give sha1 with enough
length. So maybe i can use the sha1 from "git diff --raw" ?
>
> If you are checking if that the object exists in the submodule,
> use "rev-parse --verify", which was designed for exactly that
> purpose. If you also want to verify if the object is a commit,
> which may be a good idea anyway, "rev-parse --verify $sha1_src^0".
Yes, --verify is better.
;;
>
> When reporting errors, you would want to give full 40-chars...
>
As said before, enough is ok?
> > + *)
> > + left=
> > + right=
> > + test -n "$check_src" &&
> > + left=$(GIT_DIR="$name/.git" git log --pretty=format:" <%s" \
> > + ${check_dst:+$sha1_dst..}$sha1_src 2>/dev/null)
> > +
> > + test -n "$check_dst" &&
> > + right=$(GIT_DIR="$name/.git" git log --reverse --pretty=format:" >%s" \
> > + ${check_src:+$sha1_src..}$sha1_dst 2>/dev/null)
> > + ;;
> > + esac
> > +
> > + echo "* $name $sha1_src...$sha1_dst:"
>
> While reporting like this, you would want the shortened form,
> perhaps produced your "cut -c1-7".
>
> > + if test -n "$errmsg"
> > + then
> > + echo "$errmsg"
> > + else
> > + test -n "$left" && echo "$left"
> > + test -n "$right" && echo "$right"
> > + fi
> > + echo
> > + ) | sed 's/^/# /'
> > + done
>
> I'd prefer to always have "-e" before the sed expression.
Is it not portable without "-e"?
>
> Any reason why you want separate invocation of sed inside the
> while loop? IOW, why isn't it like this?
>
> git diff --raw |
> while read ...
> do
> ...
> done | sed -e 's/^/# /'
>
Just because i'm stupid. :)
--
Ping Yin
^ permalink raw reply
* Re: [PATCH] git-svn: handle leading/trailing whitespace from svnsync revprops
From: Eric Wong @ 2008-01-12 9:12 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Dennis Schridde, git
In-Reply-To: <7vzlvbv5m9.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> > diff --git a/git-svn.perl b/git-svn.perl
> > index 3308fe1..f40ad2c 100755
> > --- a/git-svn.perl
> > +++ b/git-svn.perl
> > @@ -1758,10 +1758,16 @@ sub svnsync {
> > # see if we have it in our config, first:
> > eval {
> > my $section = "svn-remote.$self->{repo_id}";
> > - $svnsync = {
> > - url => tmp_config('--get', "$section.svnsync-url"),
> > - uuid => tmp_config('--get', "$section.svnsync-uuid"),
> > - }
> > +
> > + my $url = tmp_config('--get', "$section.svnsync-url");
> > + ($url) = ($url =~ m{^([a-z\+]+://\S+)$}) or
> > + die "doesn't look right - svn:sync-from-url is '$url'\n";
>
> When I checked tmp_config(), I thought that it was returning the
> first element (taking the output of "config --get" as a
> LF-terminated list) when called in list context, so this would
> give the correct sync-url after stripping the trailing LF for
> Dennis's case. The first assignment looks fine, but the second
> one looks very funny.
>
> Is it only me who finds that
>
> ($var) = ($var =~ m{^(any regexp)$}) or die "message"
>
> is extremely a roundabout and hard-to-read way to say:
>
> if ($var !~ m{^(the same regexp)$} {
> die "message";
> }
>
> which is much easier to read?
The statements are not equivalent, however. I'd have to add
$var = $1;
too, because I needed to extract what was inside the ( ) since the '$'
doesn't catch the trailing newline, either. I also couldn't find any of
the /sm, /m, /s switches useful for making '$' not accept the trailing
newline, either.
I also consider the "or die " part of the line to be uninteresting,
and would rather not waste extra space on it.
> I said the first one looks fine, but actually I really _hate_
> Perl subs that use wantarray and return one element in scalar
> context, and return a list in list context.
>
> This forces the programmer who calls the sub to read the code of
> the sub and know that it uses this unusual calling convention.
> It forbids them to rely on their common-sense acquired from
> experience while coding in Perl, that most functions do not do
> that, and a usual sub that is capable of returning a list in a
> list context you can find out the number of elemenets, the first
> element, and the first few elements by using:
>
> sub returns_list {
> my @a = qw(a b c);
> return @a;
> }
>
> my $number_of_elems = returns_list();
> my ($first_element) = returns_list();
> my ($first, $second) = returns_list();
>
> IOW, writing
>
> sub returns_funny {
> my @a = qw(a b c);
> return wantarray ? @a : $a[0];
> }
>
> may make you feel as if you have become a power-coder, and might
> even give you a false sense that some parts of your code can
> become simpler thanks to that, because you can now write:
>
> my $first_element = returns_list();
>
> i.e. you did not have to type WHOLE TWO LETTERS ( and )!
>
> But in the longer run, when you want/need other people to help
> maintaining such a code, you create unnecessary burden on them.
Good points, I've been mindlessly taking "interesting" things from other
Perl code I've seen over the years and using it in my own without
thinking about it too hard :x
I'll avoid them in the future. Unfortunately, Git.pm also suffers from
this as well.
--
Eric Wong
^ permalink raw reply
* Re: [PATCH 1/5] git-submodule: New subcommand 'summary' (1) - code framework
From: Ping Yin @ 2008-01-12 9:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmyrbv4ms.fsf@gitster.siamese.dyndns.org>
On Jan 12, 2008 4:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Ping Yin <pkufranky@gmail.com> writes:
>
> > + # get modified modules which have been checked out (i.e. cared by user)
> > + modules=$(git diff $cache_option --raw $head -- "$@" |
> > + grep '^:160000\|:000000 160000' |
> > + while read mod_src mod_dst sha1_src sha1_dst status name
> > + do
>
> You are listing paths that were already submodule in HEAD, or
> newly added submodule. What about a path that used to be a blob
> but is being made into submodule with the next commit (i.e. RHS
> is 160000 but LHS is not 000000)?
Hmm, i had ignored such a case.
>
>
>
> > -case "$add,$init,$update,$status,$cached" in
> > -1,,,,)
> > +case "$add,$init,$update,$summary,$status,$cached" in
> > +1,,,,,)
> > module_add "$@"
> > ;;
>
> This is simply unsustainable.
>
> Please see the other thread with Imran M Yousuf regarding the
> command dispatcher. I think that should be the first thing to
> fix before doing any change.
>
Ok, i will resend my patches after this fix
--
Ping Yin
^ permalink raw reply
* Re: [ANNOUNCE] GIT 1.5.4-rc3
From: Jeff King @ 2008-01-12 9:05 UTC (permalink / raw)
To: Ismail Dönmez; +Cc: Junio C Hamano, git
In-Reply-To: <20080112090432.GA6134@coredump.intra.peff.net>
On Sat, Jan 12, 2008 at 04:04:32AM -0500, Jeff King wrote:
> On Sat, Jan 12, 2008 at 09:47:48AM +0200, Ismail Dönmez wrote:
>
> > Removing part3.c
> > ./test-lib.sh: line 193: 19413 Aborted git-clean
> > * FAIL 5: git-clean with prefix
>
> Junio, can you please sanity check this fix (it stops the valgrind
> error, but I want to make sure my assumptions about match_pathspec are
> right).
Oh, and Ismail, can you please confirm that this causes t7300 to pass
for you?
-Peff
^ permalink raw reply
* Re: [ANNOUNCE] GIT 1.5.4-rc3
From: Jeff King @ 2008-01-12 9:04 UTC (permalink / raw)
To: Ismail Dönmez; +Cc: Junio C Hamano, git
In-Reply-To: <200801120947.48602.ismail@pardus.org.tr>
On Sat, Jan 12, 2008 at 09:47:48AM +0200, Ismail Dönmez wrote:
> So looks like tests no longer work as root, so I run make test as normal user
> and I now see t7300-clean.sh fail, this time a real failure:
>
> Removing part3.c
> ./test-lib.sh: line 193: 19413 Aborted git-clean
> * FAIL 5: git-clean with prefix
I couldn't reproduce this just running the test, but running it under
valgrind showed a memory access error. Fix is below.
Junio, can you please sanity check this fix (it stops the valgrind
error, but I want to make sure my assumptions about match_pathspec are
right).
-- >8 --
git-clean: fix off-by-one memory access when given no arguments
The "seen" variable is used by match_pathspec, and must have
as many elements as there are in the given pathspec. We
create the pathspec either from the command line arguments
_or_ from just the current prefix.
Thus allocating "seen" based upon just argc is wrong, since
if argc == 0, then we still have one pathspec, the prefix,
but we don't allocate any space in "seen".
Signed-off-by: Jeff King <peff@peff.net>
---
It might be more readable to actually set a variable pathspec_size and
use that.
builtin-clean.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-clean.c b/builtin-clean.c
index 6cad8ea..eb853a3 100644
--- a/builtin-clean.c
+++ b/builtin-clean.c
@@ -90,7 +90,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
strbuf_init(&directory, 0);
if (pathspec)
- seen = xmalloc(argc);
+ seen = xmalloc(argc > 0 ? argc : 1);
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
@@ -125,7 +125,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
continue;
if (pathspec) {
- memset(seen, 0, argc);
+ memset(seen, 0, argc > 0 ? argc : 1);
matches = match_pathspec(pathspec, ent->name, ent->len,
baselen, seen);
} else {
--
1.5.4.rc3-dirty
^ permalink raw reply related
* Re: [PATCH 3/5] git-submodule: New subcommand 'summary' (3) - limit summary size
From: Junio C Hamano @ 2008-01-12 8:36 UTC (permalink / raw)
To: Ping Yin; +Cc: git, gitster
In-Reply-To: <bce0ee9fde688c27fc788fab91a571184918da67.1200122041.git.pkufranky@gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
> @@ -265,6 +267,10 @@ set_name_rev () {
> #
> modules_summary()
> {
> + summary_limit=${summary_limit:-1000000}
Why a million?
> + summary_limit=$((summary_limit<0?1000000:summary_limit))
This is doubly bashism. Variables must be referenced with $,
and $(( conditional ? iftrue : iffalse )) is not POSIX.
^ permalink raw reply
* Re: [PATCH 2/5] git-submodule: New subcommand 'summary' (2) - hard work
From: Junio C Hamano @ 2008-01-12 8:32 UTC (permalink / raw)
To: Ping Yin; +Cc: git, gitster
In-Reply-To: <62a73e734832ad67e89be706f1f8b3dbc30cfcf4.1200122041.git.pkufranky@gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
> + git diff $cache_option --raw $head -- $modules |
> + grep '^:160000\|:000000 160000' |
> + cut -c2- |
> + while read mod_src mod_dst sha1_src sha1_dst status name
> + do
> + sha1_dst=$(echo $sha1_dst | cut -c1-7)
> + sha1_src=$(echo $sha1_src | cut -c1-7)
If you are willing to lose precision forever like this, I think
you can run "git diff" with --abbrev and lose this cut.
> + check_dst=t
> + check_src=t
> + case $status in
> + D)
> + check_dst=
> + ;;
> + A)
> + check_src=
> + ;;
I'd loosen the above grep (see my comments to your 1/5) and also
add this:
*)
continue ;# punt
;;
so that the rest of the code won't break when seeing a path that
was submodule in the HEAD but is a blob in the index.
> + esac
> +
> + (
> + errmsg=
> + unfound_src=
> + unfound_dst=
> +
> + test -z "$check_src" ||
> + GIT_DIR="$name/.git" git-rev-parse $sha1_src >&/dev/null ||
And the precision of $sha1_src matter here. Be it done with
"diff --abbrev" at the toplevel or your "cut", that may not be
unique enough in the submodule.
I think you would want to read full 40-char sha1_src and
sha1_dst with "while read", and keep that full 40-char in these
variables, and use them when calling rev-parse here.
If you are checking if that the object exists in the submodule,
use "rev-parse --verify", which was designed for exactly that
purpose. If you also want to verify if the object is a commit,
which may be a good idea anyway, "rev-parse --verify $sha1_src^0".
To be portable, use traditional ">/dev/null 2>&1", not ">&/dev/null".
> + case "$unfound_src,$unfound_dst" in
> + t,)
> + errmsg=" Warn: $name doesn't contain commit $sha1_src"
> + ;;
> + ,t)
> + errmsg=" Warn: $name doesn't contain commit $sha1_dst"
> + ;;
> + t,t)
> + errmsg=" Warn: $name doesn't contain commits $sha1_src and $sha1_dst"
> + ;;
When reporting errors, you would want to give full 40-chars...
> + *)
> + left=
> + right=
> + test -n "$check_src" &&
> + left=$(GIT_DIR="$name/.git" git log --pretty=format:" <%s" \
> + ${check_dst:+$sha1_dst..}$sha1_src 2>/dev/null)
> +
> + test -n "$check_dst" &&
> + right=$(GIT_DIR="$name/.git" git log --reverse --pretty=format:" >%s" \
> + ${check_src:+$sha1_src..}$sha1_dst 2>/dev/null)
> + ;;
> + esac
> +
> + echo "* $name $sha1_src...$sha1_dst:"
While reporting like this, you would want the shortened form,
perhaps produced your "cut -c1-7".
> + if test -n "$errmsg"
> + then
> + echo "$errmsg"
> + else
> + test -n "$left" && echo "$left"
> + test -n "$right" && echo "$right"
> + fi
> + echo
> + ) | sed 's/^/# /'
> + done
I'd prefer to always have "-e" before the sed expression.
Any reason why you want separate invocation of sed inside the
while loop? IOW, why isn't it like this?
git diff --raw |
while read ...
do
...
done | sed -e 's/^/# /'
> +
> cd "$cwd"
Hmmm.
^ permalink raw reply
* Re: [PATCH 1/5] git-submodule: New subcommand 'summary' (1) - code framework
From: Junio C Hamano @ 2008-01-12 8:18 UTC (permalink / raw)
To: Ping Yin; +Cc: git
In-Reply-To: <f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
> + # get modified modules which have been checked out (i.e. cared by user)
> + modules=$(git diff $cache_option --raw $head -- "$@" |
> + grep '^:160000\|:000000 160000' |
> + while read mod_src mod_dst sha1_src sha1_dst status name
> + do
You are listing paths that were already submodule in HEAD, or
newly added submodule. What about a path that used to be a blob
but is being made into submodule with the next commit (i.e. RHS
is 160000 but LHS is not 000000)?
> + # TODO: quote module names containing space or tab
Yes, you would need to worry about *un*quoting them.
> + test -n "$modules" &&
> + echo "# Submodules modified: "$modules &&
> + echo "#"
> + cd "$cwd"
Hmmmmmm....
> -case "$add,$init,$update,$status,$cached" in
> -1,,,,)
> +case "$add,$init,$update,$summary,$status,$cached" in
> +1,,,,,)
> module_add "$@"
> ;;
This is simply unsustainable.
Please see the other thread with Imran M Yousuf regarding the
command dispatcher. I think that should be the first thing to
fix before doing any change.
^ permalink raw reply
* Re: [ANNOUNCE] GIT 1.5.4-rc3
From: Junio C Hamano @ 2008-01-12 8:04 UTC (permalink / raw)
To: Ismail Dönmez; +Cc: git
In-Reply-To: <200801120947.48602.ismail@pardus.org.tr>
Please do not run build nor test as root.
^ permalink raw reply
* Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.
From: Junio C Hamano @ 2008-01-12 8:02 UTC (permalink / raw)
To: Stephen Sinclair; +Cc: git
In-Reply-To: <9b3e2dc20801112326p2b4eaf96tbd036ed746eff4a3@mail.gmail.com>
"Stephen Sinclair" <radarsat1@gmail.com> writes:
>> To rephrase, you would show AUTHOR when one of the conditions
>> holds true, either:
>>
>> (1) "not me" (so that we can remind that other's commit is
>> being amended); _OR_
>>
>> (2) "funny me" (so that we can catch misconfiguration.
>
> I definitely agree with (1), though having not really done much
> amending of other people's commits I can't vouch for it. I think (2)
> might not be very reliable.
Yeah, I tend to agree that (2) is probably impossible to
achieve.
Author ident should be reachable e-mail address but some people
seem to prefer committer ident to be tied to the actual machine
even if that makes the ident something that merely resembles a
valid reachable e-mail address but in fact unreachable. For
such a committer ident, taking it from hostname would be a
reasonable thing to do, but I suspect that is a minority.
Unfortunately we do not have an easy way (other than using
GIT_COMMITTER_EMAIL environment) to define different author and
committer idents.
^ permalink raw reply
* Re: [PATCH] git-svn: handle leading/trailing whitespace from svnsync revprops
From: Junio C Hamano @ 2008-01-12 7:57 UTC (permalink / raw)
To: Eric Wong; +Cc: Dennis Schridde, git
In-Reply-To: <20080112071355.GA17021@soma>
Eric Wong <normalperson@yhbt.net> writes:
> diff --git a/git-svn.perl b/git-svn.perl
> index 3308fe1..f40ad2c 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1758,10 +1758,16 @@ sub svnsync {
> # see if we have it in our config, first:
> eval {
> my $section = "svn-remote.$self->{repo_id}";
> - $svnsync = {
> - url => tmp_config('--get', "$section.svnsync-url"),
> - uuid => tmp_config('--get', "$section.svnsync-uuid"),
> - }
> +
> + my $url = tmp_config('--get', "$section.svnsync-url");
> + ($url) = ($url =~ m{^([a-z\+]+://\S+)$}) or
> + die "doesn't look right - svn:sync-from-url is '$url'\n";
When I checked tmp_config(), I thought that it was returning the
first element (taking the output of "config --get" as a
LF-terminated list) when called in list context, so this would
give the correct sync-url after stripping the trailing LF for
Dennis's case. The first assignment looks fine, but the second
one looks very funny.
Is it only me who finds that
($var) = ($var =~ m{^(any regexp)$}) or die "message"
is extremely a roundabout and hard-to-read way to say:
if ($var !~ m{^(the same regexp)$} {
die "message";
}
which is much easier to read?
I said the first one looks fine, but actually I really _hate_
Perl subs that use wantarray and return one element in scalar
context, and return a list in list context.
This forces the programmer who calls the sub to read the code of
the sub and know that it uses this unusual calling convention.
It forbids them to rely on their common-sense acquired from
experience while coding in Perl, that most functions do not do
that, and a usual sub that is capable of returning a list in a
list context you can find out the number of elemenets, the first
element, and the first few elements by using:
sub returns_list {
my @a = qw(a b c);
return @a;
}
my $number_of_elems = returns_list();
my ($first_element) = returns_list();
my ($first, $second) = returns_list();
IOW, writing
sub returns_funny {
my @a = qw(a b c);
return wantarray ? @a : $a[0];
}
may make you feel as if you have become a power-coder, and might
even give you a false sense that some parts of your code can
become simpler thanks to that, because you can now write:
my $first_element = returns_list();
i.e. you did not have to type WHOLE TWO LETTERS ( and )!
But in the longer run, when you want/need other people to help
maintaining such a code, you create unnecessary burden on them.
^ permalink raw reply
* [PATCH 5/5] git-status: configurable submodule summary size
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster, Ping Yin
In-Reply-To: <f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
Add config variable status.submodulesummary which is passed as
the arg for '--summary-limit' of 'git submodule' to limit the
submodule summary size.
The summary function is disabled by default by this config
(say status.submodulesummary is 0 by default).
Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
wt-status.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index df5be80..25ce58b 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -11,6 +11,7 @@
int wt_status_relative_paths = 1;
int wt_status_use_color = 0;
+int wt_status_submodule_summary = 0;
static char wt_status_colors[][COLOR_MAXLEN] = {
"", /* WT_STATUS_HEADER: normal */
"\033[32m", /* WT_STATUS_UPDATED: green */
@@ -275,10 +276,14 @@ static void wt_status_print_changed(struct wt_status *s)
static void wt_status_print_submodule_summary(struct wt_status *s)
{
struct child_process sm_summary;
+ char summary_limit[64];
+ sprintf(summary_limit, "%d", wt_status_submodule_summary);
const char *argv[] = {
"submodule",
"summary",
"--cached",
+ "--summary-limit",
+ summary_limit,
s->amend ? "HEAD^" : "HEAD",
NULL
};
@@ -424,6 +429,10 @@ void wt_status_print(struct wt_status *s)
int git_status_config(const char *k, const char *v)
{
+ if (!strcmp(k, "status.submodulesummary")) {
+ wt_status_submodule_summary = atoi(v);
+ return 0;
+ }
if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
wt_status_use_color = git_config_colorbool(k, v, -1);
return 0;
--
1.5.4.rc2.9.gf5146-dirty
^ permalink raw reply related
* [PATCH 2/5] git-submodule: New subcommand 'summary' (2) - hard work
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster, Ping Yin
In-Reply-To: <f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
This patch does the hard work of submodule summary and finally gives
output shown in last patch.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
git-submodule.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 67 insertions(+), 1 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 0e81484..cccb539 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -292,7 +292,73 @@ modules_summary()
# TODO: quote module names containing space or tab
test -n "$modules" &&
echo "# Submodules modified: "$modules &&
- echo "#"
+ echo "#" &&
+ git diff $cache_option --raw $head -- $modules |
+ grep '^:160000\|:000000 160000' |
+ cut -c2- |
+ while read mod_src mod_dst sha1_src sha1_dst status name
+ do
+ sha1_dst=$(echo $sha1_dst | cut -c1-7)
+ sha1_src=$(echo $sha1_src | cut -c1-7)
+ check_dst=t
+ check_src=t
+ case $status in
+ D)
+ check_dst=
+ ;;
+ A)
+ check_src=
+ ;;
+ esac
+
+ (
+ errmsg=
+ unfound_src=
+ unfound_dst=
+
+ test -z "$check_src" ||
+ GIT_DIR="$name/.git" git-rev-parse $sha1_src >&/dev/null ||
+ unfound_src=t
+
+ test -z "$check_dst" ||
+ GIT_DIR="$name/.git" git-rev-parse $sha1_dst >&/dev/null ||
+ unfound_dst=t
+
+ case "$unfound_src,$unfound_dst" in
+ t,)
+ errmsg=" Warn: $name doesn't contain commit $sha1_src"
+ ;;
+ ,t)
+ errmsg=" Warn: $name doesn't contain commit $sha1_dst"
+ ;;
+ t,t)
+ errmsg=" Warn: $name doesn't contain commits $sha1_src and $sha1_dst"
+ ;;
+ *)
+ left=
+ right=
+ test -n "$check_src" &&
+ left=$(GIT_DIR="$name/.git" git log --pretty=format:" <%s" \
+ ${check_dst:+$sha1_dst..}$sha1_src 2>/dev/null)
+
+ test -n "$check_dst" &&
+ right=$(GIT_DIR="$name/.git" git log --reverse --pretty=format:" >%s" \
+ ${check_src:+$sha1_src..}$sha1_dst 2>/dev/null)
+ ;;
+ esac
+
+ echo "* $name $sha1_src...$sha1_dst:"
+ if test -n "$errmsg"
+ then
+ echo "$errmsg"
+ else
+ test -n "$left" && echo "$left"
+ test -n "$right" && echo "$right"
+ fi
+ echo
+ ) | sed 's/^/# /'
+ done
+
cd "$cwd"
}
#
--
1.5.4.rc2.9.gf5146-dirty
^ permalink raw reply related
* [PATCH 3/5] git-submodule: New subcommand 'summary' (3) - limit summary size
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster, Ping Yin
In-Reply-To: <f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
This patches teaches git-submodule an option '--summary-limit|-n <number>'
to limit number of commits for the summary. Number 0 will disable summary
and minus number will not limit the summary size.
For beauty and clarification, the last commit for each section (backward
and forward) will always be shown disregarding the given limit. So actual
summary size may be greater than the given limit.
In the same super project of these patch series, 'git submodule -n 2
summary sm1' and 'git submodule -n 3 summary sm1' will show the same.
---------------------------------------
$ git submodule -n 2 summary sm1
# Submodules modifiled: sm1
#
# * sm1 354cd45...3f751e5:
# <one line message for C
# <one line message for B
# >... (1 more)
# >one line message for E
#
---------------------------------------
Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
git-submodule.sh | 40 +++++++++++++++++++++++++++++++++++++---
1 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index cccb539..58d0243 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -4,7 +4,8 @@
#
# Copyright (c) 2007 Lars Hjemli
-USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update|summary <commit>] [--] [<path>...]'
+USAGE="[--quiet] [--cached] [-n|--summary-limit <number>] \
+[add <repo> [-b branch]|status|init|update|summary <commit>] [--] [<path>...]"
OPTIONS_SPEC=
. git-sh-setup
require_work_tree
@@ -16,6 +17,7 @@ update=
status=
quiet=
cached=
+summary_limit=
#
# print stuff on stdout unless -q was specified
@@ -265,6 +267,10 @@ set_name_rev () {
#
modules_summary()
{
+ summary_limit=${summary_limit:-1000000}
+ summary_limit=$((summary_limit<0?1000000:summary_limit))
+ test $summary_limit = 0 && return
+
cache_option=${cached:+--cached}
if rev=$(git rev-parse --verify "$1^0" 2>/dev/null)
@@ -352,8 +358,29 @@ modules_summary()
then
echo "$errmsg"
else
- test -n "$left" && echo "$left"
- test -n "$right" && echo "$right"
+ lc0=0
+ rc0=0
+ test -n "$left" && lc0=$(echo "$left" | wc -l)
+ test -n "$right" && rc0=$(echo "$right" | wc -l)
+ lc=$((lc0<summary_limit?lc0:summary_limit))
+ rc=$((summary_limit>lc?summary_limit-lc:1))
+ rc=$((rc<rc0?rc:rc0))
+
+ if test -n "$left"
+ then
+ skip=$((lc0-lc))
+ echo "$left" | head -$((lc-1))
+ test $skip != 0 && echo " <... ($skip more)"
+ echo "$left" | tail -1
+ fi
+
+ if test -n "$right"
+ then
+ skip=$((rc0-rc))
+ echo "$right" | head -$((rc-1))
+ test $skip != 0 && echo " >... ($skip more)"
+ echo "$right" | tail -1
+ fi
fi
echo
) | sed 's/^/# /'
@@ -430,6 +457,13 @@ do
--cached)
cached=1
;;
+ -n|--summary-limit)
+ if [ -z "$2" ]; then
+ usage
+ fi
+ summary_limit="$2"
+ shift
+ ;;
--)
break
;;
--
1.5.4.rc2.9.gf5146-dirty
^ permalink raw reply related
* [PATCH 4/5] git-status: submodule summary support
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster, Ping Yin
In-Reply-To: <f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
By introducing this commit, 'git commit/status' will additionally show
'Submodules modified' section given by 'git --cached submodule summary' just
before 'Untracked files' section.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
wt-status.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index c0c2472..df5be80 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -7,6 +7,7 @@
#include "diff.h"
#include "revision.h"
#include "diffcore.h"
+#include "run-command.h"
int wt_status_relative_paths = 1;
int wt_status_use_color = 0;
@@ -271,6 +272,30 @@ static void wt_status_print_changed(struct wt_status *s)
wt_read_cache(s);
run_diff_files(&rev, 0);
}
+static void wt_status_print_submodule_summary(struct wt_status *s)
+{
+ struct child_process sm_summary;
+ const char *argv[] = {
+ "submodule",
+ "summary",
+ "--cached",
+ s->amend ? "HEAD^" : "HEAD",
+ NULL
+ };
+ char index[PATH_MAX];
+ const char *env[2] = { index, NULL };
+ snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", s->index_file);
+
+ memset(&sm_summary, 0, sizeof(sm_summary));
+ sm_summary.argv = argv;
+ sm_summary.env = env;
+ sm_summary.git_cmd = 1;
+ sm_summary.no_stdin = 1;
+ fflush(s->fp);
+ sm_summary.out = dup(fileno(s->fp)); /* run_command closes it */
+ sm_summary.no_stderr = 1;
+ run_command(&sm_summary);
+}
static void wt_status_print_untracked(struct wt_status *s)
{
@@ -374,6 +399,9 @@ void wt_status_print(struct wt_status *s)
}
wt_status_print_changed(s);
+ // we must flush s->fp here since the following call will write to s->fp in a child process
+ fflush(s->fp);
+ wt_status_print_submodule_summary(s);
wt_status_print_untracked(s);
if (s->verbose && !s->is_initial)
--
1.5.4.rc2.9.gf5146-dirty
^ permalink raw reply related
* [PATCH 1/5] git-submodule: New subcommand 'summary' (1) - code framework
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster, Ping Yin
In-Reply-To: <1200123435-16722-1-git-send-email-pkufranky@gmail.com>
Following patches teach git-submodule a new subcommand 'summary' to show
commit summary of user-cared (i.e. checked out) submodules since a given
commit (default HEAD) of super project.
For a submodule in question, a series of commits will be shown as the path
from the src commit to the dst commit, where the src commit is from the given
super project commit, and the dst commit is from the index or working tree
(switched by --cached).
.Example: a super project with modified/deleted submodules sm1 to sm3.
--------------------------------------------
$ git submodule summary
# Submodules modifiled: sm1 sm2 sm3
#
# * sm1 354cd45...3f751e5:
# <one line message for C
# <one line message for B
# >one line message for D
# >one line message for E
#
# * sm2 5c8bfb5...000000:
# <one line message for F
#
# * sm3 354cd45...3f751e5:
# Warn: sm3 doesn't contain commit 354cd45
#
--------------------------------------------
sm1 has commit C as src (given commit or HEAD) and commit E as dst (index
or working tree) as following picture shows.
--A-->B-->C (in src:354cd45)
\
-->D-->E (in dst:3f751e5)
The 'Submodules modified' section for sm1 shows how to change sm1 from
src commit C to dst commit E: firstly backward (<) to commit A from
commit C via commit B, and then forward (>) to commit E via commit D.
Illustration for output of deleted sm2 is similar.
If the src/dst commit for a submodule is not found in the work tree (say
the submodule respository in the work tree), a warning will be issued.
sm3 falls into this case.
This patch just gives the framework. It just finds the submodules to be
shown as follows.
--------------------------------------------
$ git submodule summary
# Submodules modifiled: sm1 sm2 sm3
#
--------------------------------------------
Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
git-submodule.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index ad9fe62..0e81484 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -4,7 +4,7 @@
#
# Copyright (c) 2007 Lars Hjemli
-USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update] [--] [<path>...]'
+USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update|summary <commit>] [--] [<path>...]'
OPTIONS_SPEC=
. git-sh-setup
require_work_tree
@@ -255,7 +255,46 @@ set_name_rev () {
) )
test -z "$revname" || revname=" ($revname)"
}
+#
+# Show commit summary for submodules in index or working tree relative to the given commit
+#
+# If '--cached' is given, show summary between index and given commit,
+# or between working tree and given commit
+#
+# @ = [head counting commits from (default 'HEAD'),] requested paths (default to all)
+#
+modules_summary()
+{
+ cache_option=${cached:+--cached}
+
+ if rev=$(git rev-parse --verify "$1^0" 2>/dev/null)
+ then
+ head=$rev
+ shift
+ else
+ head=HEAD
+ fi
+ cwd=$(pwd)
+ cd_to_toplevel
+
+ # get modified modules which have been checked out (i.e. cared by user)
+ modules=$(git diff $cache_option --raw $head -- "$@" |
+ grep '^:160000\|:000000 160000' |
+ while read mod_src mod_dst sha1_src sha1_dst status name
+ do
+ test $status=D && echo "$name" && continue
+ GIT_DIR="$name/.git" git-rev-parse --git-dir >/dev/null 2>&1 &&
+ echo "$name"
+ done
+ )
+
+ # TODO: quote module names containing space or tab
+ test -n "$modules" &&
+ echo "# Submodules modified: "$modules &&
+ echo "#"
+ cd "$cwd"
+}
#
# List all submodules, prefixed with:
# - submodule not initialized
@@ -305,6 +344,9 @@ do
update)
update=1
;;
+ summary)
+ summary=1
+ ;;
status)
status=1
;;
@@ -345,17 +387,20 @@ case "$add,$branch" in
;;
esac
-case "$add,$init,$update,$status,$cached" in
-1,,,,)
+case "$add,$init,$update,$summary,$status,$cached" in
+1,,,,,)
module_add "$@"
;;
-,1,,,)
+,1,,,,)
modules_init "$@"
;;
-,,1,,)
+,,1,,,)
modules_update "$@"
;;
-,,,*,*)
+,,,1,,*)
+ modules_summary "$@"
+ ;;
+,,,,*,*)
modules_list "$@"
;;
*)
--
1.5.4.rc2.9.gf5146-dirty
^ permalink raw reply related
* [PATCH 0/5] submodule summary support
From: Ping Yin @ 2008-01-12 7:37 UTC (permalink / raw)
To: git; +Cc: gitster
This patch series introduces summary support for submodule.
The first three patches teach git-submodule subcommand 'summary', and the last two patches teach git-status/git-commit 'status.submodulesummary' configuration to enable/disable submodule summary.
^ permalink raw reply
* Re: [ANNOUNCE] GIT 1.5.4-rc3
From: Ismail Dönmez @ 2008-01-12 7:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejcnwl85.fsf@gitster.siamese.dyndns.org>
Saturday 12 January 2008 09:34:34 tarihinde şunları yazmıştınız:
> sh t9200-git-cvsexportcommit.sh -i -v
Thanks for the tip, I saw the following error :
cvs
commit -F .msg 'A/newfile1.txt' 'B/newfile2.txt' 'C/newfile3.png' 'D/newfile4.png'
cvs [commit aborted]: 'root' is not allowed to commit files
So looks like tests no longer work as root, so I run make test as normal user
and I now see t7300-clean.sh fail, this time a real failure:
Removing part3.c
./test-lib.sh: line 193: 19413 Aborted git-clean
* FAIL 5: git-clean with prefix
mkdir -p build docs &&
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
(cd src/ && git-clean) &&
test -f Makefile &&
test -f README &&
test -f src/part1.c &&
test -f src/part2.c &&
test -f a.out &&
test ! -f src/part3.c &&
test -f docs/manual.txt &&
test -f obj.o &&
test -f build/lib.so
Regards,
ismail
--
Never learn by your mistakes, if you do you may never dare to try again.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox