* Re: [PATCH 6/8] imap-send: change msg_data from storing (char *, len) to storing strbuf
From: Michael Haggerty @ 2012-11-30 13:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeremy White, Johannes Schindelin, Jeff King
In-Reply-To: <7vboegp04x.fsf@alter.siamese.dyndns.org>
On 11/29/2012 10:30 PM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>
>> struct msg_data stored (char *, len) of the data to be included in a
>
> That (<type>, <varname>) is a bit funny notation, even though it is
> understandable.
I understand that it is funny, but it seems like the clearest way to
express what is meant in a way that fits in the summary line. Feel free
to change it if you like.
>> message, kept the character data NUL-terminated, etc., much like a
>> strbuf would do. So change it to use a struct strbuf. This makes the
>> code clearer and reduces copying a little bit.
>>
>> A side effect of this change is that the memory for each message is
>> freed after it is used rather than leaked, though that detail is
>> unimportant given that imap-send is a top-level command.
>>
>> --
>
> ?
If by "?" you are wondering where the memory leak was, it was:
* The while loop in main() called split_msg()
* split_msg() cleared the msg_data structure using
memset(msg, 0, sizeof *msg)
* split_msg() copied the first message out of all_msgs using
xmemdupz() and stored the result to msg->data
* The msg_data was passed to imap_store_msg(). Its contents were
copied to cb.data (which will be freed in the imap functions) but
the original was left unfreed.
* The next time through the loop, split_msg() zeroed the msg_data
structure again, thus discarding the pointer to the xmemdupz()ed
memory.
The leak caused more memory than necessary to be allocated (worst case:
nearly the total size of all_msgs). But (a) all_msgs is already stored
in memory, so the wastage is at most a factor of 2; and (b) this all
happens in main() shortly before program exit erases all sins.
I didn't bother documenting this in the commit message because the patch
changes the code anyway, but feel free to add the above explanation to
the commit message if you think it is useful.
>> For some reason, there is a bunch of infrastructure in this file for
>> dealing with IMAP flags, although there is nothing in the code that
>> actually allows any flags to be set. If there is no plan to add
>> support for flags in the future, a bunch of code could be ripped out
>> and "struct msg_data" could be completely replaced with strbuf.
>
> Yeah, after all these years we have kept the unused flags field
> there and nobody needed anything out of it. I am OK with a removal
> if it is done at the very end of the series.
I don't think the removal of flags needs to be part of the same series.
I suggest a separate patch series dedicated to deleting *all* the extra
imap infrastructure at once. That being said, I'm not committing to do
so. (We could add it to an "straightforward projects for aspiring git
developers" list, if we had such a thing.)
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* A typo in RelNotes/1.8.2 (v1.8.0.1-347-gf94c325)
From: Horst H. von Brand @ 2012-11-30 13:15 UTC (permalink / raw)
To: gitster; +Cc: git
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
Casilla 110-V, Valparaiso, Chile 2340000 Fax: +56 32 2797513
^ permalink raw reply
* [PATCH] Typo in Documentation/RelNotes/1.8.2.txt
From: Horst H. von Brand @ 2012-11-30 13:15 UTC (permalink / raw)
To: gitster; +Cc: git, Horst H. von Brand
In-Reply-To: <1354281302-9605-1-git-send-email-vonbrand@inf.utfsm.cl>
From: "Horst H. von Brand" <vonbrand@inf.utfsm.cl>
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
---
Documentation/RelNotes/1.8.1.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/RelNotes/1.8.1.txt b/Documentation/RelNotes/1.8.1.txt
index 8f53af3..ce5b5ec 100644
--- a/Documentation/RelNotes/1.8.1.txt
+++ b/Documentation/RelNotes/1.8.1.txt
@@ -79,7 +79,7 @@ UI, Workflows & Features
case and removes the submodule working tree when it is safe.
* "git send-email" used to prompt for the sender address, even when
- the committer identify is well specified (e.g. via user.name and
+ the committer identity is well specified (e.g. via user.name and
user.email configuration variables). The command no longer gives
this prompt when not necessary.
--
1.8.0.1.347.gf94c325
^ permalink raw reply related
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Andreas Schwab @ 2012-11-30 13:07 UTC (permalink / raw)
To: viresh kumar; +Cc: Junio C Hamano, git
In-Reply-To: <CAOh2x==NBeeoE2=PhaDC143ZF_xHKD5m=Po+-DS2X43CEeGiEQ@mail.gmail.com>
viresh kumar <viresh.kumar@linaro.org> writes:
> I was just thinking if we can ignore case for commiter name while
> listing stuff here?
> So, that we get over any manual mistakes from commiter.
See git-shortlog(1), section Mapping Authors.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Damien Robert @ 2012-11-30 13:01 UTC (permalink / raw)
To: git
In-Reply-To: <CAJDDKr7yr2JSutcEy1mz-SfMq8ZdNzR3+s++ooenn5+wD-LDAw@mail.gmail.com>
David Aguilar wrote in message
<CAJDDKr7yr2JSutcEy1mz-SfMq8ZdNzR3+s++ooenn5+wD-LDAw@mail.gmail.com>:
> There's a feature that does exactly this.
> http://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html
By the way, the mailmap ignore case which is annoying.
I have commits as Damien.Olivier.Robert+git@gmail.com and a dummy email
address robert@numenor.night-elves. I thought that putting:
Damien Robert <Damien.Olivier.Robert+git@gmail.com> <robert@numenor.night-elves>
in the .mailmap would unify the two adresses, but it does not:
git shortlog -se
15 Damien Robert <Damien.Olivier.Robert+git@gmail.com>
266 Damien Robert <damien.olivier.robert+git@gmail.com>
as you can see, the Damien.Olivier.Robert+git as been lowercased to
damien.olivier.robert, so I am forced to write a mailmap like this:
Damien Robert <Damien.Olivier.Robert+git@gmail.com> <robert@numenor.night-elves>
Damien Robert <Damien.Olivier.Robert+git@gmail.com> <Damien.Olivier.Robert+git@gmail.com>
git shortlog -se
281 Damien Robert <damien.olivier.robert+git@gmail.com>
^ permalink raw reply
* [PATCH v2 4/4] t4041 (diff-submodule-option): modernize style
From: Ramkumar Ramachandra @ 2012-11-30 11:37 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
In-Reply-To: <1354275456-11104-1-git-send-email-artagnon@gmail.com>
- Enclose tests in single quotes as opposed to double quotes. This is
the prevalent style in other tests.
- Remove the unused variable $head4_full.
- Indent the expected output so that it lines up with the rest of the
test text.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t4041-diff-submodule-option.sh | 459 +++++++++++++++++++-------------------
1 files changed, 229 insertions(+), 230 deletions(-)
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index d745197..2704df2 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -34,41 +34,41 @@ add_file . foo >/dev/null
head1=$(add_file sm1 foo1 foo2)
fullhead1=$(cd sm1; git rev-parse --verify HEAD)
-test_expect_success 'added submodule' "
+test_expect_success 'added submodule' '
git add sm1 &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 0000000...$head1 (new submodule)
-EOF
+ Submodule sm1 0000000...$head1 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'added submodule, set diff.submodule' "
+test_expect_success 'added submodule, set diff.submodule' '
git config diff.submodule log &&
git add sm1 &&
git diff --cached >actual &&
cat >expected <<-EOF &&
-Submodule sm1 0000000...$head1 (new submodule)
-EOF
+ Submodule sm1 0000000...$head1 (new submodule)
+ EOF
git config --unset diff.submodule &&
test_cmp expected actual
-"
+'
-test_expect_success '--submodule=short overrides diff.submodule' "
+test_expect_success '--submodule=short overrides diff.submodule' '
test_config diff.submodule log &&
git add sm1 &&
git diff --submodule=short --cached >actual &&
cat >expected <<-EOF &&
-diff --git a/sm1 b/sm1
-new file mode 160000
-index 0000000..$head1
---- /dev/null
-+++ b/sm1
-@@ -0,0 +1 @@
-+Subproject commit $fullhead1
-EOF
+ diff --git a/sm1 b/sm1
+ new file mode 160000
+ index 0000000..$head1
+ --- /dev/null
+ +++ b/sm1
+ @@ -0,0 +1 @@
+ +Subproject commit $fullhead1
+ EOF
test_cmp expected actual
-"
+'
test_expect_success 'diff.submodule does not affect plumbing' '
test_config diff.submodule log &&
@@ -88,47 +88,47 @@ test_expect_success 'diff.submodule does not affect plumbing' '
commit_file sm1 &&
head2=$(add_file sm1 foo3)
-test_expect_success 'modified submodule(forward)' "
+test_expect_success 'modified submodule(forward)' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head1..$head2:
- > Add foo3
-EOF
+ Submodule sm1 $head1..$head2:
+ > Add foo3
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule(forward)' "
+test_expect_success 'modified submodule(forward)' '
git diff --submodule=log >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head1..$head2:
- > Add foo3
-EOF
+ Submodule sm1 $head1..$head2:
+ > Add foo3
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule(forward) --submodule' "
+test_expect_success 'modified submodule(forward) --submodule' '
git diff --submodule >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head1..$head2:
- > Add foo3
-EOF
+ Submodule sm1 $head1..$head2:
+ > Add foo3
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule(forward) --submodule=short' "
fullhead2=$(cd sm1; git rev-parse --verify HEAD)
+test_expect_success 'modified submodule(forward) --submodule=short' '
git diff --submodule=short >actual &&
cat >expected <<-EOF &&
-diff --git a/sm1 b/sm1
-index $head1..$head2 160000
---- a/sm1
-+++ b/sm1
-@@ -1 +1 @@
--Subproject commit $fullhead1
-+Subproject commit $fullhead2
-EOF
+ diff --git a/sm1 b/sm1
+ index $head1..$head2 160000
+ --- a/sm1
+ +++ b/sm1
+ @@ -1 +1 @@
+ -Subproject commit $fullhead1
+ +Subproject commit $fullhead2
+ EOF
test_cmp expected actual
-"
+'
commit_file sm1 &&
head3=$(
@@ -137,29 +137,28 @@ head3=$(
git rev-parse --short --verify HEAD
)
-test_expect_success 'modified submodule(backward)' "
+test_expect_success 'modified submodule(backward)' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head2..$head3 (rewind):
- < Add foo3
- < Add foo2
-EOF
+ Submodule sm1 $head2..$head3 (rewind):
+ < Add foo3
+ < Add foo2
+ EOF
test_cmp expected actual
-"
+'
-head4=$(add_file sm1 foo4 foo5) &&
-head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)
-test_expect_success 'modified submodule(backward and forward)' "
+head4=$(add_file sm1 foo4 foo5)
+test_expect_success 'modified submodule(backward and forward)' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head2...$head4:
- > Add foo5
- > Add foo4
- < Add foo3
- < Add foo2
-EOF
+ Submodule sm1 $head2...$head4:
+ > Add foo5
+ > Add foo4
+ < Add foo3
+ < Add foo2
+ EOF
test_cmp expected actual
-"
+'
commit_file sm1 &&
mv sm1 sm1-bak &&
@@ -169,319 +168,319 @@ git add sm1 &&
rm -f sm1 &&
mv sm1-bak sm1
-test_expect_success 'typechanged submodule(submodule->blob), --cached' "
+test_expect_success 'typechanged submodule(submodule->blob), --cached' '
git diff --submodule=log --cached >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head4...0000000 (submodule deleted)
-diff --git a/sm1 b/sm1
-new file mode 100644
-index 0000000..$head5
---- /dev/null
-+++ b/sm1
-@@ -0,0 +1 @@
-+sm1
-EOF
+ Submodule sm1 $head4...0000000 (submodule deleted)
+ diff --git a/sm1 b/sm1
+ new file mode 100644
+ index 0000000..$head5
+ --- /dev/null
+ +++ b/sm1
+ @@ -0,0 +1 @@
+ +sm1
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'typechanged submodule(submodule->blob)' "
+test_expect_success 'typechanged submodule(submodule->blob)' '
git diff --submodule=log >actual &&
cat >expected <<-EOF &&
-diff --git a/sm1 b/sm1
-deleted file mode 100644
-index $head5..0000000
---- a/sm1
-+++ /dev/null
-@@ -1 +0,0 @@
--sm1
-Submodule sm1 0000000...$head4 (new submodule)
-EOF
+ diff --git a/sm1 b/sm1
+ deleted file mode 100644
+ index $head5..0000000
+ --- a/sm1
+ +++ /dev/null
+ @@ -1 +0,0 @@
+ -sm1
+ Submodule sm1 0000000...$head4 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
rm -rf sm1 &&
git checkout-index sm1
-test_expect_success 'typechanged submodule(submodule->blob)' "
+test_expect_success 'typechanged submodule(submodule->blob)' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head4...0000000 (submodule deleted)
-diff --git a/sm1 b/sm1
-new file mode 100644
-index 0000000..$head5
---- /dev/null
-+++ b/sm1
-@@ -0,0 +1 @@
-+sm1
-EOF
+ Submodule sm1 $head4...0000000 (submodule deleted)
+ diff --git a/sm1 b/sm1
+ new file mode 100644
+ index 0000000..$head5
+ --- /dev/null
+ +++ b/sm1
+ @@ -0,0 +1 @@
+ +sm1
+ EOF
test_cmp expected actual
-"
+'
rm -f sm1 &&
test_create_repo sm1 &&
head6=$(add_file sm1 foo6 foo7)
-test_expect_success 'nonexistent commit' "
fullhead6=$(cd sm1; git rev-parse --verify HEAD)
+test_expect_success 'nonexistent commit' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head4...$head6 (commits not present)
-EOF
+ Submodule sm1 $head4...$head6 (commits not present)
+ EOF
test_cmp expected actual
-"
+'
commit_file
-test_expect_success 'typechanged submodule(blob->submodule)' "
+test_expect_success 'typechanged submodule(blob->submodule)' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-diff --git a/sm1 b/sm1
-deleted file mode 100644
-index $head5..0000000
---- a/sm1
-+++ /dev/null
-@@ -1 +0,0 @@
--sm1
-Submodule sm1 0000000...$head6 (new submodule)
-EOF
+ diff --git a/sm1 b/sm1
+ deleted file mode 100644
+ index $head5..0000000
+ --- a/sm1
+ +++ /dev/null
+ @@ -1 +0,0 @@
+ -sm1
+ Submodule sm1 0000000...$head6 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
commit_file sm1 &&
-test_expect_success 'submodule is up to date' "
+test_expect_success 'submodule is up to date' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-EOF
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'submodule contains untracked content' "
+test_expect_success 'submodule contains untracked content' '
echo new > sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains untracked content
-EOF
+ Submodule sm1 contains untracked content
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'submodule contains untracked content (untracked ignored)' "
+test_expect_success 'submodule contains untracked content (untracked ignored)' '
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'submodule contains untracked content (dirty ignored)' "
+test_expect_success 'submodule contains untracked content (dirty ignored)' '
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'submodule contains untracked content (all ignored)' "
+test_expect_success 'submodule contains untracked content (all ignored)' '
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'submodule contains untracked and modifed content' "
+test_expect_success 'submodule contains untracked and modifed content' '
echo new > sm1/foo6 &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains untracked content
-Submodule sm1 contains modified content
-EOF
+ Submodule sm1 contains untracked content
+ Submodule sm1 contains modified content
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'submodule contains untracked and modifed content (untracked ignored)' "
+test_expect_success 'submodule contains untracked and modifed content (untracked ignored)' '
echo new > sm1/foo6 &&
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains modified content
-EOF
+ Submodule sm1 contains modified content
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' "
+test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' '
echo new > sm1/foo6 &&
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'submodule contains untracked and modifed content (all ignored)' "
+test_expect_success 'submodule contains untracked and modifed content (all ignored)' '
echo new > sm1/foo6 &&
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'submodule contains modifed content' "
+test_expect_success 'submodule contains modifed content' '
rm -f sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains modified content
-EOF
+ Submodule sm1 contains modified content
+ EOF
test_cmp expected actual
-"
+'
(cd sm1; git commit -mchange foo6 >/dev/null) &&
-test_expect_success 'submodule is modified' "
head8=$(cd sm1; git rev-parse --short --verify HEAD) &&
+test_expect_success 'submodule is modified' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked content' "
+test_expect_success 'modified submodule contains untracked content' '
echo new > sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains untracked content
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 contains untracked content
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked content (untracked ignored)' "
+test_expect_success 'modified submodule contains untracked content (untracked ignored)' '
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked content (dirty ignored)' "
+test_expect_success 'modified submodule contains untracked content (dirty ignored)' '
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked content (all ignored)' "
+test_expect_success 'modified submodule contains untracked content (all ignored)' '
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'modified submodule contains untracked and modifed content' "
+test_expect_success 'modified submodule contains untracked and modifed content' '
echo modification >> sm1/foo6 &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains untracked content
-Submodule sm1 contains modified content
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 contains untracked content
+ Submodule sm1 contains modified content
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked and modifed content (untracked ignored)' "
+test_expect_success 'modified submodule contains untracked and modifed content (untracked ignored)' '
echo modification >> sm1/foo6 &&
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains modified content
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 contains modified content
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked and modifed content (dirty ignored)' "
+test_expect_success 'modified submodule contains untracked and modifed content (dirty ignored)' '
echo modification >> sm1/foo6 &&
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' "
+test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' '
echo modification >> sm1/foo6 &&
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
! test -s actual
-"
+'
-test_expect_success 'modified submodule contains modifed content' "
+test_expect_success 'modified submodule contains modifed content' '
rm -f sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 contains modified content
-Submodule sm1 $head6..$head8:
- > change
-EOF
+ Submodule sm1 contains modified content
+ Submodule sm1 $head6..$head8:
+ > change
+ EOF
test_cmp expected actual
-"
+'
rm -rf sm1
-test_expect_success 'deleted submodule' "
+test_expect_success 'deleted submodule' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6...0000000 (submodule deleted)
-EOF
+ Submodule sm1 $head6...0000000 (submodule deleted)
+ EOF
test_cmp expected actual
-"
+'
test_create_repo sm2 &&
head7=$(add_file sm2 foo8 foo9) &&
git add sm2
-test_expect_success 'multiple submodules' "
+test_expect_success 'multiple submodules' '
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6...0000000 (submodule deleted)
-Submodule sm2 0000000...$head7 (new submodule)
-EOF
+ Submodule sm1 $head6...0000000 (submodule deleted)
+ Submodule sm2 0000000...$head7 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'path filter' "
+test_expect_success 'path filter' '
git diff-index -p --submodule=log HEAD sm2 >actual &&
cat >expected <<-EOF &&
-Submodule sm2 0000000...$head7 (new submodule)
-EOF
+ Submodule sm2 0000000...$head7 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
commit_file sm2
-test_expect_success 'given commit' "
+test_expect_success 'given commit' '
git diff-index -p --submodule=log HEAD^ >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6...0000000 (submodule deleted)
-Submodule sm2 0000000...$head7 (new submodule)
-EOF
+ Submodule sm1 $head6...0000000 (submodule deleted)
+ Submodule sm2 0000000...$head7 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
-test_expect_success 'given commit --submodule' "
+test_expect_success 'given commit --submodule' '
git diff-index -p --submodule HEAD^ >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6...0000000 (submodule deleted)
-Submodule sm2 0000000...$head7 (new submodule)
-EOF
+ Submodule sm1 $head6...0000000 (submodule deleted)
+ Submodule sm2 0000000...$head7 (new submodule)
+ EOF
test_cmp expected actual
-"
+'
fullhead7=$(cd sm2; git rev-parse --verify HEAD)
-test_expect_success 'given commit --submodule=short' "
+test_expect_success 'given commit --submodule=short' '
git diff-index -p --submodule=short HEAD^ >actual &&
cat >expected <<-EOF &&
-diff --git a/sm1 b/sm1
-deleted file mode 160000
-index $head6..0000000
---- a/sm1
-+++ /dev/null
-@@ -1 +0,0 @@
--Subproject commit $fullhead6
-diff --git a/sm2 b/sm2
-new file mode 160000
-index 0000000..$head7
---- /dev/null
-+++ b/sm2
-@@ -0,0 +1 @@
-+Subproject commit $fullhead7
-EOF
- test_cmp expected actual
-"
+ diff --git a/sm1 b/sm1
+ deleted file mode 160000
+ index $head6..0000000
+ --- a/sm1
+ +++ /dev/null
+ @@ -1 +0,0 @@
+ -Subproject commit $fullhead6
+ diff --git a/sm2 b/sm2
+ new file mode 160000
+ index 0000000..$head7
+ --- /dev/null
+ +++ b/sm2
+ @@ -0,0 +1 @@
+ +Subproject commit $fullhead7
+ EOF
+ test_cmp expected actual
+'
test_expect_success 'setup .git file for sm2' '
(cd sm2 &&
@@ -493,9 +492,9 @@ test_expect_success 'setup .git file for sm2' '
test_expect_success 'diff --submodule with .git file' '
git diff --submodule HEAD^ >actual &&
cat >expected <<-EOF &&
-Submodule sm1 $head6...0000000 (submodule deleted)
-Submodule sm2 0000000...$head7 (new submodule)
-EOF
+ Submodule sm1 $head6...0000000 (submodule deleted)
+ Submodule sm2 0000000...$head7 (new submodule)
+ EOF
test_cmp expected actual
'
--
1.7.8.1.362.g5d6df.dirty
^ permalink raw reply related
* [PATCH v2 3/4] t4041 (diff-submodule-option): rewrite add_file() routine
From: Ramkumar Ramachandra @ 2012-11-30 11:37 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
In-Reply-To: <1354275456-11104-1-git-send-email-artagnon@gmail.com>
Instead of "cd there and then come back", use the "cd there in a
subshell" pattern. Also fix '&&' chaining in one place.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t4041-diff-submodule-option.sh | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 08d549a..d745197 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -11,18 +11,17 @@ This test tries to verify the sanity of the --submodule option of git diff.
. ./test-lib.sh
add_file () {
- sm=$1
- shift
- owd=$(pwd)
- cd "$sm"
- for name; do
- echo "$name" > "$name" &&
- git add "$name" &&
- test_tick &&
- git commit -m "Add $name"
- done >/dev/null
- git rev-parse --short --verify HEAD
- cd "$owd"
+ (
+ cd "$1" &&
+ shift &&
+ for name; do
+ echo "$name" > "$name" &&
+ git add "$name" &&
+ test_tick &&
+ git commit -m "Add $name" || exit
+ done >/dev/null &&
+ git rev-parse --short --verify HEAD
+ )
}
commit_file () {
test_tick &&
--
1.7.8.1.362.g5d6df.dirty
^ permalink raw reply related
* [PATCH v2 2/4] t4041 (diff-submodule-option): parse digests sensibly
From: Ramkumar Ramachandra @ 2012-11-30 11:37 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
In-Reply-To: <1354275456-11104-1-git-send-email-artagnon@gmail.com>
`git rev-list --max-count=1 HEAD` is a roundabout way of saying `git
rev-parse --verify HEAD`; replace a bunch of instances of the former
with the latter. Also, don't unnecessarily `cut -c1-7` the rev-parse
output when the `--short` option is available.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t4041-diff-submodule-option.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 5377639..08d549a 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -21,7 +21,7 @@ add_file () {
test_tick &&
git commit -m "Add $name"
done >/dev/null
- git rev-parse --verify HEAD | cut -c1-7
+ git rev-parse --short --verify HEAD
cd "$owd"
}
commit_file () {
@@ -33,7 +33,7 @@ test_create_repo sm1 &&
add_file . foo >/dev/null
head1=$(add_file sm1 foo1 foo2)
-fullhead1=$(cd sm1; git rev-list --max-count=1 $head1)
+fullhead1=$(cd sm1; git rev-parse --verify HEAD)
test_expect_success 'added submodule' "
git add sm1 &&
@@ -116,8 +116,8 @@ EOF
test_cmp expected actual
"
-fullhead2=$(cd sm1; git rev-list --max-count=1 $head2)
test_expect_success 'modified submodule(forward) --submodule=short' "
+fullhead2=$(cd sm1; git rev-parse --verify HEAD)
git diff --submodule=short >actual &&
cat >expected <<-EOF &&
diff --git a/sm1 b/sm1
@@ -135,7 +135,7 @@ commit_file sm1 &&
head3=$(
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
- git rev-parse --verify HEAD | cut -c1-7
+ git rev-parse --short --verify HEAD
)
test_expect_success 'modified submodule(backward)' "
@@ -220,8 +220,8 @@ EOF
rm -f sm1 &&
test_create_repo sm1 &&
head6=$(add_file sm1 foo6 foo7)
-fullhead6=$(cd sm1; git rev-list --max-count=1 $head6)
test_expect_success 'nonexistent commit' "
+fullhead6=$(cd sm1; git rev-parse --verify HEAD)
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
Submodule sm1 $head4...$head6 (commits not present)
@@ -318,8 +318,8 @@ EOF
"
(cd sm1; git commit -mchange foo6 >/dev/null) &&
-head8=$(cd sm1; git rev-parse --verify HEAD | cut -c1-7) &&
test_expect_success 'submodule is modified' "
+head8=$(cd sm1; git rev-parse --short --verify HEAD) &&
git diff-index -p --submodule=log HEAD >actual &&
cat >expected <<-EOF &&
Submodule sm1 $head6..$head8:
@@ -461,7 +461,7 @@ EOF
test_cmp expected actual
"
-fullhead7=$(cd sm2; git rev-list --max-count=1 $head7)
+fullhead7=$(cd sm2; git rev-parse --verify HEAD)
test_expect_success 'given commit --submodule=short' "
git diff-index -p --submodule=short HEAD^ >actual &&
--
1.7.8.1.362.g5d6df.dirty
^ permalink raw reply related
* [PATCH v2 1/4] t4041 (diff-submodule-option): don't hardcode SHA-1 in expected outputs
From: Ramkumar Ramachandra @ 2012-11-30 11:37 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
In-Reply-To: <1354275456-11104-1-git-send-email-artagnon@gmail.com>
The expected SHA-1 digests are always available in variables. Use
them instead of hardcoding.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t4041-diff-submodule-option.sh | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 57e8a9d..5377639 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -62,7 +62,7 @@ test_expect_success '--submodule=short overrides diff.submodule' "
cat >expected <<-EOF &&
diff --git a/sm1 b/sm1
new file mode 160000
-index 0000000..a2c4dab
+index 0000000..$head1
--- /dev/null
+++ b/sm1
@@ -0,0 +1 @@
@@ -77,7 +77,7 @@ test_expect_success 'diff.submodule does not affect plumbing' '
cat >expected <<-EOF &&
diff --git a/sm1 b/sm1
new file mode 160000
- index 0000000..a2c4dab
+ index 0000000..$head1
--- /dev/null
+++ b/sm1
@@ -0,0 +1 @@
@@ -173,10 +173,10 @@ mv sm1-bak sm1
test_expect_success 'typechanged submodule(submodule->blob), --cached' "
git diff --submodule=log --cached >actual &&
cat >expected <<-EOF &&
-Submodule sm1 41fbea9...0000000 (submodule deleted)
+Submodule sm1 $head4...0000000 (submodule deleted)
diff --git a/sm1 b/sm1
new file mode 100644
-index 0000000..9da5fb8
+index 0000000..$head5
--- /dev/null
+++ b/sm1
@@ -0,0 +1 @@
@@ -190,7 +190,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
cat >expected <<-EOF &&
diff --git a/sm1 b/sm1
deleted file mode 100644
-index 9da5fb8..0000000
+index $head5..0000000
--- a/sm1
+++ /dev/null
@@ -1 +0,0 @@
--
1.7.8.1.362.g5d6df.dirty
^ permalink raw reply related
* [PATCH v2 0/4] t4041 (diff-submodule-option): minor cleanup
From: Ramkumar Ramachandra @ 2012-11-30 11:37 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
Hi,
v1 is here: 1354005692-2809-1-git-send-email-artagnon@gmail.com
This is in response to Junio's review of v1.
Thanks.
Ram
Ramkumar Ramachandra (4):
t4041 (diff-submodule-option): don't hardcode SHA-1 in expected
outputs
t4041 (diff-submodule-option): parse digests sensibly
t4041 (diff-submodule-option): rewrite add_file() routine
t4041 (diff-submodule-option): modernize style
t/t4041-diff-submodule-option.sh | 496 +++++++++++++++++++-------------------
1 files changed, 247 insertions(+), 249 deletions(-)
--
1.7.8.1.362.g5d6df.dirty
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Max Horn @ 2012-11-30 11:19 UTC (permalink / raw)
To: viresh kumar; +Cc: Nicolas Pitre, Junio C Hamano, git
In-Reply-To: <CAKohponGXq=P88Y=cmUPbRCeJ--VkMvJyw5th1T-WdGQnn4xWg@mail.gmail.com>
On 30.11.2012, at 04:35, viresh kumar wrote:
> On 30 November 2012 09:03, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
>
>> Have a look at the .mailmap file in the top directory of your repo.
>
> Repeating what i said to David in other mail:
>
> I have my name there :)
>
> I thought using names with different case is actually different then misspelling
> it. And so, everybody must not be required to update their names in mailmap
> with different case. So, with same email id and same name (that may be in
> different case), we can show commits together in shortlog.
I don't see how wrong case is different from any other form of misspelling. And mailmap is there precisely to handle such problems. Now, if these case issues were for some reasons very frequent, it might be worth adding dedicated support for it. But this seems dubious to me -- do you have any evidence for this? Indeed, do you have more than just the one example?
In a nutshell, there seem to be two options here, and I know which *I* find more appealing ;)
1) continue this discussion over several emails to design a new feature (an option, config setting, whatever) to handle your special case, then sit down and write code for it, add documentation, add test cases to test it.
2) You just add a single entry to your mailmap to solve your problem at hand. :-)
Cheers,
Max
^ permalink raw reply
* Re: [PATCH] Extend runtime prefix computation
From: Michael Weiser @ 2012-11-30 10:45 UTC (permalink / raw)
To: Erik Faye-Lund; +Cc: git
In-Reply-To: <CABPQNSYhscHdnTFLye=oif_R84kpdaVsrCK+-174v7Ugrae_yQ@mail.gmail.com>
Hello Erik,
On Fri, Nov 30, 2012 at 11:20:52AM +0100, Erik Faye-Lund wrote:
> > +#if defined(__linux__)
> > + struct stat st;
> > + if (!stat("/proc/self/exe", &st)) {
> > + abs_argv0 = xstrdup(real_path("/proc/self/exe"));
> > + }
> > +#elif defined(__APPLE__)
> > + /* Mac OS X has realpath, which incidentally allocates its own
> > + * memory, which in turn is why we do all the xstrdup's in the
> > + * other cases. */
> > + abs_argv0 = realpath(argv0, NULL);
> > +#endif
> ...perhaps a "GetModuleFileName(NULL, ...)" for Windows is in place here?
Agreed. However, I do not use git on Windows and don't have a Windows
devel toolchain in place. So I guess this should be added in a separate
patch by someone actually in need of it and in a position to develop and
test it?
Thanks,
--
Michael Weiser science + computing ag
Senior Systems Engineer Geschaeftsstelle Duesseldorf
Martinstrasse 47-55, Haus A
phone: +49 211 302 708 32 D-40223 Duesseldorf
fax: +49 211 302 708 50 www.science-computing.de
--
Vorstandsvorsitzender/Chairman of the board of management:
Gerd-Lothar Leonhart
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Michael Heinrichs,
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
^ permalink raw reply
* Re: [PATCH] Extend runtime prefix computation
From: Erik Faye-Lund @ 2012-11-30 10:20 UTC (permalink / raw)
To: Michael Weiser; +Cc: git
In-Reply-To: <20121127163004.GC7499@science-computing.de>
On Tue, Nov 27, 2012 at 5:30 PM, Michael Weiser
<M.Weiser@science-computing.de> wrote:
> Support determining the binaries' installation path at runtime even if
> called without any path components (i.e. via search path). Implement
> fallback to compiled-in prefix if determination fails or is impossible.
>
> Signed-off-by: Michael Weiser <weiser@science-computing.de>
> ---
> - Has two very minor memory leaks - function is called only once per
> program execution. Do we care? Alternative: Use static buffer instead.
>
> exec_cmd.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++-------------
> 1 files changed, 53 insertions(+), 15 deletions(-)
>
> diff --git a/exec_cmd.c b/exec_cmd.c
> index 125fa6f..d50d7f8 100644
> --- a/exec_cmd.c
> +++ b/exec_cmd.c
> @@ -4,28 +4,22 @@
> #define MAX_ARGS 32
>
> static const char *argv_exec_path;
> -static const char *argv0_path;
> +static const char *argv0_path = NULL;
>
> const char *system_path(const char *path)
> {
> -#ifdef RUNTIME_PREFIX
> - static const char *prefix;
> -#else
> static const char *prefix = PREFIX;
> -#endif
> struct strbuf d = STRBUF_INIT;
>
> if (is_absolute_path(path))
> return path;
>
> #ifdef RUNTIME_PREFIX
> - assert(argv0_path);
> - assert(is_absolute_path(argv0_path));
> -
> - if (!prefix &&
> - !(prefix = strip_path_suffix(argv0_path, GIT_EXEC_PATH)) &&
> - !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
> - !(prefix = strip_path_suffix(argv0_path, "git"))) {
> + if (!argv0_path ||
> + !is_absolute_path(argv0_path) ||
> + (!(prefix = strip_path_suffix(argv0_path, GIT_EXEC_PATH)) &&
> + !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
> + !(prefix = strip_path_suffix(argv0_path, "git")))) {
> prefix = PREFIX;
> trace_printf("RUNTIME_PREFIX requested, "
> "but prefix computation failed. "
> @@ -41,20 +35,64 @@ const char *system_path(const char *path)
> const char *git_extract_argv0_path(const char *argv0)
> {
> const char *slash;
> + char *abs_argv0 = NULL;
>
> if (!argv0 || !*argv0)
> return NULL;
> slash = argv0 + strlen(argv0);
>
> + /* walk to the first slash from the end */
> while (argv0 <= slash && !is_dir_sep(*slash))
> slash--;
>
> + /* if there was a slash ... */
> if (slash >= argv0) {
> - argv0_path = xstrndup(argv0, slash - argv0);
> - return slash + 1;
> + /* ... it's either an absolute path */
> + if (is_absolute_path(argv0)) {
> + /* FIXME: memory leak here */
> + argv0_path = xstrndup(argv0, slash - argv0);
> + return slash + 1;
> + }
> +
> + /* ... or a relative path, in which case we have to make it
> + * absolute first and do the whole thing again */
> + abs_argv0 = xstrdup(real_path(argv0));
> + } else {
> + /* argv0 is no path at all, just a name. Resolve it into a
> + * path. Unfortunately, this gets system specific. */
> +#if defined(__linux__)
> + struct stat st;
> + if (!stat("/proc/self/exe", &st)) {
> + abs_argv0 = xstrdup(real_path("/proc/self/exe"));
> + }
> +#elif defined(__APPLE__)
> + /* Mac OS X has realpath, which incidentally allocates its own
> + * memory, which in turn is why we do all the xstrdup's in the
> + * other cases. */
> + abs_argv0 = realpath(argv0, NULL);
> +#endif
...perhaps a "GetModuleFileName(NULL, ...)" for Windows is in place here?
^ permalink raw reply
* Re: [PATCH/RFC 0/5] win32: support echo for terminal-prompt
From: Erik Faye-Lund @ 2012-11-30 10:16 UTC (permalink / raw)
To: git, msysgit; +Cc: peff
In-Reply-To: <1352815447-8824-1-git-send-email-kusmabite@gmail.com>
Ping?
On Tue, Nov 13, 2012 at 3:04 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
> We currently only support getpass, which does not echo at all, for
> git_terminal_prompt on Windows. The Windows console is perfectly
> capable of doing this, so let's make it so.
>
> This implementation tries to reuse the /dev/tty-code as much as
> possible.
>
> The big reason that this becomes a bit hairy is that Ctrl+C needs
> to be handled correctly, so we don't leak the console state to a
> non-echoing setting when a user aborts.
>
> Windows makes this bit a little bit tricky, in that we need to
> implement SIGINT for fgetc. However, I suspect that this is a good
> thing to do in the first place.
>
> An earlier iteration was also breifly discussed here:
> http://mid.gmane.org/CABPQNSaUCEDU4+2N63n0k_XwSXOP_iFZG3GEYSPSBPcSVV8wRQ@mail.gmail.com
>
> The series can also be found here, only with an extra patch that
> makes the (interactive) testing a bit easier:
>
> https://github.com/kusma/git/tree/work/terminal-cleanup
>
> Erik Faye-Lund (5):
> mingw: make fgetc raise SIGINT if apropriate
> compat/terminal: factor out echo-disabling
> compat/terminal: separate input and output handles
> mingw: reuse tty-version of git_terminal_prompt
> mingw: get rid of getpass implementation
>
> compat/mingw.c | 91 +++++++++++++++++++++++++++-----------
> compat/mingw.h | 8 +++-
> compat/terminal.c | 129 ++++++++++++++++++++++++++++++++++++++++--------------
> 3 files changed, 169 insertions(+), 59 deletions(-)
>
> --
> 1.8.0.7.gbeffeda
>
^ permalink raw reply
* Re: [PATCH 1/2] git-fast-import.txt: improve documentation for quoted paths
From: Matthieu Moy @ 2012-11-30 9:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7vvccop6dv.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> That "shell-style" contradicts with what fast-import.c says, though.
> It claims to grok \octal and described as C-style.
As Peff mentionned, my last version is better, although still a bit
incomplete. My new version documents things that _must_ be escaped, but
not what _can_.
I'm reluctant to try being exhaustive in the .txt documentation if there
is an exhaustive comment in the code. One option would be to actually
turn the comment into an official specification by moving it to the .txt
file, but that goes far beyond the scope of my patch.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: [PATCH] t4049: avoid test failures on filemode challenged file systems (Windows)
From: Johannes Sixt @ 2012-11-30 7:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Antoine Pelisse
In-Reply-To: <7vfw3sp232.fsf@alter.siamese.dyndns.org>
Am 11/29/2012 21:48, schrieb Junio C Hamano:
> I've tested this with the testpen set on vfat mounted on my Linux
> box, ...
> and it seems to work OK,
Works well here on Windows, too.
Thanks,
-- Hannes
^ permalink raw reply
* Re: [PATCH v7 p2 1/2] fast-export: don't handle uninteresting refs
From: Felipe Contreras @ 2012-11-30 5:57 UTC (permalink / raw)
To: Max Horn; +Cc: git, Junio C Hamano, Jeff King
In-Reply-To: <8FA492C2-71B0-44AB-B816-AFB6C91DC01C@quendi.de>
On Thu, Nov 29, 2012 at 2:16 AM, Max Horn <postbox@quendi.de> wrote:
>
> On 28.11.2012, at 23:23, Felipe Contreras wrote:
>
>> They have been marked as UNINTERESTING for a reason, lets respect that.
>>
>> Currently the first ref is handled properly, but not the rest:
>>
>> % git fast-export master ^uninteresting ^foo ^bar
>
> All these refs are assumed to point to the same object, right? I think it would be better if the commit message stated that explicitly. To make up for the lost space, you could then get rid of one of the four refs, I think three are sufficient to drive the message home ;-).
Yeah, they point to the same object.
> <snip>
>
>> The reason this happens is that before traversing the commits,
>> fast-export checks if any of the refs point to the same object, and any
>> duplicated ref gets added to a list in order to issue 'reset' commands
>> after the traversing. Unfortunately, it's not even checking if the
>> commit is flagged as UNINTERESTING. The fix of course, is to do
>> precisely that.
>
> Hm... So this might be me being a stupid n00b (I am not yet that familiar with the internal rep of things in git and all...)... but I found the "precisely that" par very confusing, because right afterwards, you say:
Yeah, the next part was added afterwards.
>> However, in order to do it properly we need to get the UNINTERESTING flag
>> from the command line ref, not from the commit object.
>
> So this sounds like you are saying "we do *precisely* that, except we don't, because it is more complicated, so we actually don't do this *precisely*, just manner of speaking..."
Well, we do check fro the UNINTERESTING flag, but on the ref, not on the commit.
> Some details here are beyond my knowledge, I am afraid, so I have to resort to guess: In particular it is not clear to me why the "however" part pops up: Reading it makes it sound as if the commit object also carries an UNINTERESTING flag, but we can't use it because of some reason (perhaps it doesn't have the semantics we need?), so we have to look at revs.pending instead. Right? Wrong? Or is it because the commit objects actually do *not* carry the UNINTERESTING bits, hence we need to look at revs.pending. Or is it due to yet another reason?
It's actually revs.cmdline, I typed the wrong one.
If you have two refs pointing to the same object, and you do 'one
^two', the object (e.g. 8c7a786) will get the UNINTERESTING flag, but
that doesn't tell us anything about the ref being a positive or a
negative one, and revs.pending only has the object flags. On the other
hand revs.cmdline does have the flags for the refs.
Does that explain it?
> Anyway, other than these nitpicky questions, this whole thing looks very logical to me, description and code alike. I also played around with tons of "fast-export" invocations, with and without this patch, and it seems to do what the description says. Finally, I went to the various long threads discussion prior versions of this patch, in particular those starting at
> http://thread.gmane.org/gmane.comp.version-control.git/208725
> and
> http://thread.gmane.org/gmane.comp.version-control.git/209355/focus=209370
>
> These contained some concerns. Sadly, several of those discussions ultimately degenerated into not-so-pleasant exchanges :-(, and my impression is that as a result some people are not so inclined to comment on these patches anymore at all. Which is a pity :-(. But overall, it seems this patch makes nothing worse, but fixes some things; and it is simple enough that it shouldn't make future improvements harder.
>
> So *I* at least am quite happy with this, it helps me! My impression is that Felipe's latest patch addresses most concerns people raised by means of an improved description. I couldn't find any in those threads that I feel still applies -- but of course those people should speak for themselves, I am simply afraid they don't want to be part of this anymore :-(.
Indeed. For all the concerns given I made a response to how that
either is not true, or doesn't really matter, and in the case of the
latter, I asked for examples where it would matter, only to receive
nothing. For whatever reason involved people are not responding, not a
single valid concern has been raised and remained.
So I think it's good.
Cheers.
--
Felipe Contreras
^ permalink raw reply
* New git.pot is generated for git 1.8.1 l10n round 2
From: Jiang Xin @ 2012-11-30 5:01 UTC (permalink / raw)
To: Byrial Jensen, Ralf Thielow,
Ævar Arnfjörð Bjarmason, Marco Paolone,
Vincent van Ravesteijn, Marco Sousa, Peter Krefting,
Trần Ngọc Quân, David Hrbáč
Cc: Git List
Hi,
New "git.pot" is generated from v1.8.0.1-347-gf94c3 in the master branch.
l10n: Update git.pot (5 new, 1 removed messages)
L10n for git 1.8.1 round 2: Generate po/git.pot from v1.8.0.1-347-gf94c3.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
This update is for the l10n of upcoming git 1.8.1. You can get it from
the usual place:
https://github.com/git-l10n/git-po/
--
Jiang Xin
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Viresh Kumar @ 2012-11-30 3:35 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LFD.2.02.1211292231520.4576@xanadu.home>
On 30 November 2012 09:03, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> Have a look at the .mailmap file in the top directory of your repo.
Repeating what i said to David in other mail:
I have my name there :)
I thought using names with different case is actually different then misspelling
it. And so, everybody must not be required to update their names in mailmap
with different case. So, with same email id and same name (that may be in
different case), we can show commits together in shortlog.
--
viresh
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Nicolas Pitre @ 2012-11-30 3:33 UTC (permalink / raw)
To: viresh kumar; +Cc: Junio C Hamano, git
In-Reply-To: <CAOh2x==NBeeoE2=PhaDC143ZF_xHKD5m=Po+-DS2X43CEeGiEQ@mail.gmail.com>
On Fri, 30 Nov 2012, viresh kumar wrote:
> Hi Junio and others,
>
> I have a query. git shortlog lists the patches submitted per commiter, like:
>
> > Viresh Kumar (7):
> > cpufreq: Improve debug prints
> > cpufreq: return early from __cpufreq_driver_getavg()
> > cpufreq: governors: remove redundant code
> > cpufreq: Fix sparse warnings by updating cputime64_t to u64
> > cpufreq: Fix sparse warning by making local function static
> > cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
> > cpufreq: Make sure target freq is within limits
>
> > viresh kumar (3):
> > cpufreq / core: Fix typo in comment describing show_bios_limit()
> > cpufreq / core: Fix printing of governor and driver name
> > cpufreq: Move common part from governors to separate file, v2
>
> I know, there was something wrong at my end and i have commited stuff
> with different cases.
>
> I was just thinking if we can ignore case for commiter name while
> listing stuff here?
> So, that we get over any manual mistakes from commiter.
Have a look at the .mailmap file in the top directory of your repo.
Nicolas
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: Viresh Kumar @ 2012-11-30 3:32 UTC (permalink / raw)
To: David Aguilar; +Cc: Junio C Hamano, git
In-Reply-To: <CAJDDKr7yr2JSutcEy1mz-SfMq8ZdNzR3+s++ooenn5+wD-LDAw@mail.gmail.com>
On 30 November 2012 08:54, David Aguilar <davvid@gmail.com> wrote:
> There's a feature that does exactly this.
>
> http://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html
>
> See the section called "Mapping Authors".
> It discusses the .mailmap file.
I have my name there :)
I thought using names with different case is actually different then misspelling
it. And so, everybody must not be required to update their names in mailmap
with different case. So, with same email id and same name (that may be in
different case), we can show commits together in shortlog.
--
viresh
^ permalink raw reply
* Re: [Query] Can we ignore case for commiters name in shortlog?
From: David Aguilar @ 2012-11-30 3:24 UTC (permalink / raw)
To: viresh kumar; +Cc: Junio C Hamano, git
In-Reply-To: <CAOh2x==NBeeoE2=PhaDC143ZF_xHKD5m=Po+-DS2X43CEeGiEQ@mail.gmail.com>
On Thu, Nov 29, 2012 at 6:09 PM, viresh kumar <viresh.kumar@linaro.org> wrote:
> Hi Junio and others,
>
> I have a query. git shortlog lists the patches submitted per commiter, like:
>
>> Viresh Kumar (7):
>> cpufreq: Improve debug prints
>> cpufreq: return early from __cpufreq_driver_getavg()
>> cpufreq: governors: remove redundant code
>> cpufreq: Fix sparse warnings by updating cputime64_t to u64
>> cpufreq: Fix sparse warning by making local function static
>> cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
>> cpufreq: Make sure target freq is within limits
>
>> viresh kumar (3):
>> cpufreq / core: Fix typo in comment describing show_bios_limit()
>> cpufreq / core: Fix printing of governor and driver name
>> cpufreq: Move common part from governors to separate file, v2
>
> I know, there was something wrong at my end and i have commited stuff
> with different cases.
>
> I was just thinking if we can ignore case for commiter name while
> listing stuff here?
> So, that we get over any manual mistakes from commiter.
There's a feature that does exactly this.
http://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html
See the section called "Mapping Authors".
It discusses the .mailmap file.
--
David
^ permalink raw reply
* Re: [PATCH v5 0/2] submodule update: add --remote for submodule's upstream changes
From: W. Trevor King @ 2012-11-30 3:27 UTC (permalink / raw)
To: Phil Hord
Cc: Git, Junio C Hamano, Heiko Voigt, Jeff King, Shawn Pearce,
Jens Lehmann, Nahor
In-Reply-To: <CABURp0piLAG+hEsav-uro+nq9ZRZ9CFFjVG8VKYk3ZtYvRi8=A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3121 bytes --]
On Thu, Nov 29, 2012 at 08:11:20PM -0500, Phil Hord wrote:
> On Thu, Nov 29, 2012 at 2:13 PM, W. Trevor King <wking@tremily.us> wrote:
> > On Thu, Nov 29, 2012 at 01:29:12PM -0500, Phil Hord wrote:
> >> For that reason, I don't like the --pull switch since it implies a
> >> fetch, but I will not always want to do a fetch.
> >
> > $ git submodule update --remote --no-fetch
> >
> > will not fetch the submodule remotes.
>
> This seems precisely backwards to me. Why not use
>
> $ git submodule update --remote --fetch
>
> to do your "default" behavior instead? I suppose I am arguing
> against the tide of the dominant workflow, but the fetch-by-default
> idea needlessly conflates two primitive operations: "float" and
> "fetch".
Because --no-fetch is the existing option, and if it ain't broke… ;).
> >> I don't know which remote I should be tracking, though. I suppose
> >> it is 'origin' for now, but maybe it is just whatever
> >> $superproject's HEAD's remote-tracking branch indicates.
> >
> > With the --remote series, I always use "origin" because that's what
> > `submodule add` should be setting up. If people want to change that
> > up by hand, we may need a submodule.<name>.remote configuration
> > option.
>
> I've always felt that the "origin" defaults are broken and are simply
> being ignored because most users do not trip over them. But ISTR that
> submodule commands use the remote indicated by the superproject's
> current remote-tracking configuration, with a fallback to 'origin' if
> there is none. Sort of a "best effort" algorithm, I think. Am I
> remembering that wrong?
The current code uses a bare "git-fetch". I'm not sure what that
defaults to if you're on a detached head. If it bothers you, I'm fine
adding the submodule.<name>.remote option in v6.
> >> I am not sure I want the gitlinks in superproject to update automatically
> >> in the index, but I definitely do not want to automatically create a commit
> >> for them.
> >
> > Commits are dissabled by default (see my recent --commit RFC for how
> > they would be enabled).
> >
> >> But I really don't want to figure out how to handle submodule
> >> collisions during a merge (or rebase!) of my superproject with changes that
> >> someone else auto-committed in his local $superproject as he and I
> >> arbitrarily floated up the upstream independently. There is nothing but
> >> loathing down that path.
> >
> > This is true. I'm not sure how gitlink collisions are currently
> > handled…
>
> They've always been trouble for me. But it may be that I am ignorant.
I haven't dealt with any gitlink merges, but I think that supporting
easy gitlink merges is orthogonal to this --remote option. For simple
cases like "autocommitted submodule floats", one of the conflicting
gitlinks will be an ancestor of the other, so it should be easy to
automate that merge.
Cheers,
Trevor
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [Query] Can we ignore case for commiters name in shortlog?
From: viresh kumar @ 2012-11-30 2:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Hi Junio and others,
I have a query. git shortlog lists the patches submitted per commiter, like:
> Viresh Kumar (7):
> cpufreq: Improve debug prints
> cpufreq: return early from __cpufreq_driver_getavg()
> cpufreq: governors: remove redundant code
> cpufreq: Fix sparse warnings by updating cputime64_t to u64
> cpufreq: Fix sparse warning by making local function static
> cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
> cpufreq: Make sure target freq is within limits
> viresh kumar (3):
> cpufreq / core: Fix typo in comment describing show_bios_limit()
> cpufreq / core: Fix printing of governor and driver name
> cpufreq: Move common part from governors to separate file, v2
I know, there was something wrong at my end and i have commited stuff
with different cases.
I was just thinking if we can ignore case for commiter name while
listing stuff here?
So, that we get over any manual mistakes from commiter.
--
viresh
^ permalink raw reply
* [PATCH v6 8/8] push: cleanup push rules comment
From: Chris Rorvick @ 2012-11-30 1:41 UTC (permalink / raw)
To: git
Cc: Chris Rorvick, Angelo Borsotti, Drew Northup, Michael Haggerty,
Philip Oakley, Johannes Sixt, Kacper Kornet, Jeff King,
Felipe Contreras, Junio C Hamano
In-Reply-To: <1354239700-3325-1-git-send-email-chris@rorvick.com>
Rewrite to remove inter-dependencies amongst the rules.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
---
remote.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/remote.c b/remote.c
index ee0c1e5..6309a87 100644
--- a/remote.c
+++ b/remote.c
@@ -1319,27 +1319,29 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
continue;
}
- /* This part determines what can overwrite what.
- * The rules are:
+ /*
+ * The below logic determines whether an individual
+ * refspec A:B can be pushed. The push will succeed
+ * if any of the following are true:
*
- * (0) you can always use --force or +A:B notation to
- * selectively force individual ref pairs.
+ * (1) the remote reference B does not exist
*
- * (1) if the old thing does not exist, it is OK.
+ * (2) the remote reference B is being removed (i.e.,
+ * pushing :B where no source is specified)
*
- * (2) if the destination is under refs/tags/ you are
- * not allowed to overwrite it; tags are expected
- * to be static once created
+ * (3) the update meets all fast-forwarding criteria:
*
- * (3) if you do not have the old thing, you are not allowed
- * to overwrite it; you would not know what you are losing
- * otherwise.
+ * (a) the destination is not under refs/tags/
+ * (b) the old is a commit
+ * (c) the new is a descendant of the old
*
- * (4) if old is a commit and new is a descendant of old
- * (implying new is commit-ish), it is OK.
+ * NOTE: We must actually have the old object in
+ * order to overwrite it in the remote reference,
+ * and that the new object must be commit-ish.
+ * These are implied by (b) and (c) respectively.
*
- * (5) regardless of all of the above, removing :B is
- * always allowed.
+ * (4) it is forced using the +A:B notation, or by
+ * passing the --force argument
*/
ref->not_forwardable = !is_forwardable(ref);
--
1.8.0.158.g0c4328c
^ permalink raw reply related
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