GNU bug report logs -
#21120
vc-chlog fails if git submodules are dirty
Previous Next
To reply to this bug, email your comments to 21120 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-vc-dwim <at> gnu.org
:
bug#21120
; Package
vc-dwim
.
(Thu, 23 Jul 2015 00:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Assaf Gordon <assafgordon <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-vc-dwim <at> gnu.org
.
(Thu, 23 Jul 2015 00:11:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
it seems that if a project using git has a submodule that is dirty, vc-chlog will fail to print the information about all the files.
To reproduce:
====
git clone git://git.sv.gnu.org/hello.git
cd hello/
./bootstrap
echo >> bootstrap.conf
echo >> gnulib/cfg.mk
echo >> src/hello.c
====
The diff looks like this:
===
$ git diff
diff --git a/bootstrap.conf b/bootstrap.conf
index 9e6b005..79d4c5b 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -119,3 +119,4 @@ bootstrap_epilogue()
done
fi
}
+
diff --git a/gnulib b/gnulib
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d
+Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d-dirty
diff --git a/src/hello.c b/src/hello.c
index 8e6cfbd..f0d12de 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -187,3 +187,4 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
This is free software: you are free to change and redistribute it.\n\
There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
}
+
===
But vc-chlog will stop after the gnulib submodule:
===
$ vc-chlog
2015-07-22 gordon <gordon <at> hostname>
* bootstrap.conf:
* gnulib:
===
A bit of debugging seems to show that in 'vc-chlog', the output of 'processed-diff()' is:
bootstrap.conf 1 3 9 0-0-122-122
gnulib 1 11 15 1-1-1-1
src/hello.c 1 18 24 0-0-190-190
Then 'func_extract_identifiers()' calls 'func_apply_tmp_patch()' which runs 'patch', and patch fails.
One possible work-around is to ignore submodules in 'vc-dwim' (attached patch).
Another possible thing is to make 'vc-dwim' abort if there are dirty submodules, on the assumption that 'vc-dwim' is meant to prevent problematic commits, and a dirty submodule is a hint of a potential problem.
related to this approach, there was a discussion couple of months about about adding a server-side git hook in savannah to prevent such commits, but it was decided against such forcible approach. perhaps warning about dirty submodules in 'vc-dwim' is more polite?
http://lists.gnu.org/archive/html/coreutils/2015-04/msg00017.html
regards,
- assaf
[vc-dwim-ignore-git-submodules.patch (text/x-diff, attachment)]
Information forwarded
to
bug-vc-dwim <at> gnu.org
:
bug#21120
; Package
vc-dwim
.
(Tue, 28 Jul 2015 05:23:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 21120 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jul 22, 2015 at 4:54 PM, Assaf Gordon <assafgordon <at> gmail.com> wrote:
> Hello,
>
> it seems that if a project using git has a submodule that is dirty, vc-chlog
> will fail to print the information about all the files.
>
> To reproduce:
> ====
> git clone git://git.sv.gnu.org/hello.git
> cd hello/
> ./bootstrap
> echo >> bootstrap.conf
> echo >> gnulib/cfg.mk
> echo >> src/hello.c
> ====
>
> The diff looks like this:
> ===
> $ git diff
> diff --git a/bootstrap.conf b/bootstrap.conf
> index 9e6b005..79d4c5b 100644
> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -119,3 +119,4 @@ bootstrap_epilogue()
> done
> fi
> }
> +
> diff --git a/gnulib b/gnulib
> --- a/gnulib
> +++ b/gnulib
> @@ -1 +1 @@
> -Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d
> +Subproject commit b9bfe78424b871f5b92e5ee9e7d21ef951a6801d-dirty
> diff --git a/src/hello.c b/src/hello.c
> index 8e6cfbd..f0d12de 100644
> --- a/src/hello.c
> +++ b/src/hello.c
> @@ -187,3 +187,4 @@ License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>\n\
> This is free software: you are free to change and redistribute it.\n\
> There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
> }
> +
> ===
>
> But vc-chlog will stop after the gnulib submodule:
> ===
> $ vc-chlog
> 2015-07-22 gordon <gordon <at> hostname>
>
> * bootstrap.conf:
> * gnulib:
> ===
>
> A bit of debugging seems to show that in 'vc-chlog', the output of
> 'processed-diff()' is:
> bootstrap.conf 1 3 9 0-0-122-122
> gnulib 1 11 15 1-1-1-1
> src/hello.c 1 18 24 0-0-190-190
>
> Then 'func_extract_identifiers()' calls 'func_apply_tmp_patch()' which runs
> 'patch', and patch fails.
> One possible work-around is to ignore submodules in 'vc-dwim' (attached
> patch).
>
> Another possible thing is to make 'vc-dwim' abort if there are dirty
> submodules, on the assumption that 'vc-dwim' is meant to prevent problematic
> commits, and a dirty submodule is a hint of a potential problem.
> related to this approach, there was a discussion couple of months about
> about adding a server-side git hook in savannah to prevent such commits, but
> it was decided against such forcible approach. perhaps warning about dirty
> submodules in 'vc-dwim' is more polite?
> http://lists.gnu.org/archive/html/coreutils/2015-04/msg00017.html
Hi Assaf,
Wow. Thank you for diving in and writing all of that.
Issuing a warning does have a little more appeal to me, but I would be happy
with a complete patch implementing either behavior (i.e., updating NEWS
and adding a test).
Are you inclined to write that?
Information forwarded
to
bug-vc-dwim <at> gnu.org
:
bug#21120
; Package
vc-dwim
.
(Wed, 29 Jul 2015 23:45:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 21120 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
On Mon, Jul 27, 2015 at 10:22:08PM -0700, Jim Meyering wrote:
>On Wed, Jul 22, 2015 at 4:54 PM, Assaf Gordon <assafgordon <at> gmail.com> wrote:
>> it seems that if a project using git has a submodule that is dirty, vc-chlog
>> will fail to print the information about all the files.
<...>
>> Another possible thing is to make 'vc-dwim' abort if there are dirty
>> submodules, on the assumption that 'vc-dwim' is meant to prevent problematic
>> commits, and a dirty submodule is a hint of a potential problem.
>Issuing a warning does have a little more appeal to me, but I would be happy
>with a complete patch implementing either behavior (i.e., updating NEWS
>and adding a test).
For starters, attached is the simpler approach of silently ignoring
dirty git submodules with `vc-dwim --diff`.
Comments welcomed,
-assaf
[vc-dwim-ignore-git-submodules.patch (text/x-diff, attachment)]
Information forwarded
to
bug-vc-dwim <at> gnu.org
:
bug#21120
; Package
vc-dwim
.
(Thu, 30 Jul 2015 16:10:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 21120 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jul 29, 2015 at 4:44 PM, Assaf Gordon <assafgordon <at> gmail.com> wrote:
> Hello,
>
> On Mon, Jul 27, 2015 at 10:22:08PM -0700, Jim Meyering wrote:
>>
>> On Wed, Jul 22, 2015 at 4:54 PM, Assaf Gordon <assafgordon <at> gmail.com>
>> wrote:
>>>
>>> it seems that if a project using git has a submodule that is dirty,
>>> vc-chlog
>>> will fail to print the information about all the files.
>
> <...>
>
>>> Another possible thing is to make 'vc-dwim' abort if there are dirty
>>> submodules, on the assumption that 'vc-dwim' is meant to prevent
>>> problematic
>>> commits, and a dirty submodule is a hint of a potential problem.
>
>
>> Issuing a warning does have a little more appeal to me, but I would be
>> happy
>> with a complete patch implementing either behavior (i.e., updating NEWS
>> and adding a test).
>
> For starters, attached is the simpler approach of silently ignoring dirty
> git submodules with `vc-dwim --diff`.
Very nice work. A perfect patch :-)
Pushed verbatim.
Thank you!
This bug report was last modified 9 years and 324 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.