git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git and tagging hook
@ 2008-10-06  4:45 Kristis Makris
  2008-10-06  7:17 ` Andreas Ericsson
  2008-10-06  7:20 ` Andreas Ericsson
  0 siblings, 2 replies; 15+ messages in thread
From: Kristis Makris @ 2008-10-06  4:45 UTC (permalink / raw)
  To: git-u79uwXL29TY76Z2rM5mHXA; +Cc: scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ


[-- Attachment #1.1: Type: text/plain, Size: 366 bytes --]

Hello,

It seems that Git (at least v1.5.6) does not offer hooks on tag creation
(a pre-tag and a post-tag hook). I need such a hook for integrating tag
activities with an issue-tracker. Is it possible to add this hook ?

I had asked about this in the past, but did not receive a response.

http://bugzilla.mkgnu.net/show_bug.cgi?id=991

Thanks,
Kristis

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 188 bytes --]

_______________________________________________
scmbug-users mailing list
scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ@public.gmane.org
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-06  4:45 Git and tagging hook Kristis Makris
@ 2008-10-06  7:17 ` Andreas Ericsson
  2008-10-07 17:13   ` Kristis Makris
  2008-10-06  7:20 ` Andreas Ericsson
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-06  7:17 UTC (permalink / raw)
  To: Kristis Makris; +Cc: git, scmbug-users

Kristis Makris wrote:
> Hello,
> 
> It seems that Git (at least v1.5.6) does not offer hooks on tag creation
> (a pre-tag and a post-tag hook). I need such a hook for integrating tag
> activities with an issue-tracker. Is it possible to add this hook ?
> 

What you want is probably the post-receive or 'update' hooks on whatever
repository you consider your public watering hole for your project.
Integrating with an issue-tracker from the developers machine would be
utterly stupid, as it would prevent tagging from happening while not
connected.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-06  4:45 Git and tagging hook Kristis Makris
  2008-10-06  7:17 ` Andreas Ericsson
@ 2008-10-06  7:20 ` Andreas Ericsson
  2008-10-07 17:30   ` Kristis Makris
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-06  7:20 UTC (permalink / raw)
  To: Kristis Makris; +Cc: git

Next time, don't include a members-only list in the CC, please. The
usual action when replying to an email on git@vger is to "Reply All",
which doesn't play nicely with such lists and will render one list
archive incomplete (since people will inevitably cull that other
list from their CC's after having sent to it once).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-06  7:17 ` Andreas Ericsson
@ 2008-10-07 17:13   ` Kristis Makris
  2008-10-07 17:28     ` Jakub Narebski
  0 siblings, 1 reply; 15+ messages in thread
From: Kristis Makris @ 2008-10-07 17:13 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: git, scmbug-users

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

But the post-receive is NOT executed when I apply a tag.

I want the integration when I apply the tag to a local repository, NOT
only when I push/pull.

On Mon, 2008-10-06 at 09:17 +0200, Andreas Ericsson wrote:
> Kristis Makris wrote:
> > Hello,
> > 
> > It seems that Git (at least v1.5.6) does not offer hooks on tag creation
> > (a pre-tag and a post-tag hook). I need such a hook for integrating tag
> > activities with an issue-tracker. Is it possible to add this hook ?
> > 
> 
> What you want is probably the post-receive or 'update' hooks on whatever
> repository you consider your public watering hole for your project.
> Integrating with an issue-tracker from the developers machine would be
> utterly stupid, as it would prevent tagging from happening while not
> connected.
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-07 17:13   ` Kristis Makris
@ 2008-10-07 17:28     ` Jakub Narebski
  2008-10-08 16:47       ` Kristis Makris
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Narebski @ 2008-10-07 17:28 UTC (permalink / raw)
  To: git; +Cc: scmbug-users

Kristis Makris wrote:

> But the post-receive is NOT executed when I apply a tag.
> 
> I want the integration when I apply the tag to a local repository, NOT
> only when I push/pull.

If you are talking about taging locally, you can simply make an alias
or do something after tagging. Search archives for description when
it is worth to add a hook, and when it is not.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-06  7:20 ` Andreas Ericsson
@ 2008-10-07 17:30   ` Kristis Makris
  2008-10-08  6:12     ` Andreas Ericsson
  0 siblings, 1 reply; 15+ messages in thread
From: Kristis Makris @ 2008-10-07 17:30 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On Mon, 2008-10-06 at 09:20 +0200, Andreas Ericsson wrote:
> Next time, don't include a members-only list in the CC, please. The
> usual action when replying to an email on git@vger is to "Reply All",
> which doesn't play nicely with such lists and will render one list
> archive incomplete (since people will inevitably cull that other
> list from their CC's after having sent to it once).

Why would they cull that other list, if the usual action is to "Reply
All" ?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-07 17:30   ` Kristis Makris
@ 2008-10-08  6:12     ` Andreas Ericsson
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-08  6:12 UTC (permalink / raw)
  To: Kristis Makris; +Cc: git

Kristis Makris wrote:
> On Mon, 2008-10-06 at 09:20 +0200, Andreas Ericsson wrote:
>> Next time, don't include a members-only list in the CC, please. The
>> usual action when replying to an email on git@vger is to "Reply All",
>> which doesn't play nicely with such lists and will render one list
>> archive incomplete (since people will inevitably cull that other
>> list from their CC's after having sent to it once).
> 
> Why would they cull that other list, if the usual action is to "Reply
> All" ?

Because it's a members-only list. Like me, I'm sure many will get
annoyed enough to remember to remove it for further postings on the
subject. Those nonsensical "awaiting moderator approval" emails are
irritating noise, and since they're "To: me" and get a low spamrank
they go straight to the high-priority folder. Many others on this
list use similar filters as it's a neat way of dealing with several
high-volume mailing lists sanely.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-07 17:28     ` Jakub Narebski
@ 2008-10-08 16:47       ` Kristis Makris
  2008-10-08 17:40         ` Andreas Ericsson
  0 siblings, 1 reply; 15+ messages in thread
From: Kristis Makris @ 2008-10-08 16:47 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: git-u79uwXL29TY76Z2rM5mHXA, scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ


[-- Attachment #1.1: Type: text/plain, Size: 791 bytes --]

On Tue, 2008-10-07 at 19:28 +0200, Jakub Narebski wrote:
> Kristis Makris wrote:
> 
> > But the post-receive is NOT executed when I apply a tag.
> > 
> > I want the integration when I apply the tag to a local repository, NOT
> > only when I push/pull.
> 
> If you are talking about taging locally, you can simply make an alias
> or do something after tagging. Search archives for description when
> it is worth to add a hook, and when it is not.

I am looking for a guarantee that is better than casually saying
"simply". I will be providing the integration work to users that may not
be as comfortable with making aliases. 

I still don't see why a hook on local tagging is not available. Is it
possible to add support in Git for such a hook ? Both pre-tag and
post-tag.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 188 bytes --]

_______________________________________________
scmbug-users mailing list
scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ@public.gmane.org
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-08 16:47       ` Kristis Makris
@ 2008-10-08 17:40         ` Andreas Ericsson
  2008-10-14 17:22           ` Jan Hudec
  0 siblings, 1 reply; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-08 17:40 UTC (permalink / raw)
  To: Kristis Makris; +Cc: Jakub Narebski, git

Kristis Makris wrote:
> On Tue, 2008-10-07 at 19:28 +0200, Jakub Narebski wrote:
>> Kristis Makris wrote:
>>
>>> But the post-receive is NOT executed when I apply a tag.
>>>
>>> I want the integration when I apply the tag to a local repository, NOT
>>> only when I push/pull.
>> If you are talking about taging locally, you can simply make an alias
>> or do something after tagging. Search archives for description when
>> it is worth to add a hook, and when it is not.
> 
> I am looking for a guarantee that is better than casually saying
> "simply". I will be providing the integration work to users that may not
> be as comfortable with making aliases. 
> 
> I still don't see why a hook on local tagging is not available. Is it
> possible to add support in Git for such a hook ? Both pre-tag and
> post-tag.

Because noone's ever needed one before. If aliases can't do what you
want, write a patch to support it and hope Junio accepts it. It's really
quite straight-forward. Make sure you read Documentation/SubmittingPatches
before you send it.

Note though that use of tags on the developer's side will still be up
to the developer and not something you can force through other means
than policy or convention.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-08 17:40         ` Andreas Ericsson
@ 2008-10-14 17:22           ` Jan Hudec
       [not found]             ` <20081014172227.GB6931-hYs7FtC5zV+YSD4dQj0czg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Hudec @ 2008-10-14 17:22 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Kristis Makris, Jakub Narebski, git

On Wed, Oct 08, 2008 at 19:40:02 +0200, Andreas Ericsson wrote:
> Kristis Makris wrote:
>> On Tue, 2008-10-07 at 19:28 +0200, Jakub Narebski wrote:
>>> Kristis Makris wrote:
>>>> I want the integration when I apply the tag to a local repository, NOT
>>>> only when I push/pull.

Care to explain why that would ever be useful? It's local, which means that:
 - the user can take it back without a trace it ever happened (git tag -d or
   even git update-ref -d) and
 - noone except the user will see it anyway, so it's not like they should
   care either.

Besides, you don't need git tag to create a tag in git, so the hook wouldn't
really be guaranteed anyway (I mean, just like the commit hook is not -- you
can still commit by calling write-tree, commit-tree and update-ref and avoid
the hook).

>>> If you are talking about taging locally, you can simply make an alias
>>> or do something after tagging. Search archives for description when
>>> it is worth to add a hook, and when it is not.
>>
>> I am looking for a guarantee that is better than casually saying
>> "simply". I will be providing the integration work to users that may not
>> be as comfortable with making aliases. 
>>
>> I still don't see why a hook on local tagging is not available. Is it
>> possible to add support in Git for such a hook ? Both pre-tag and
>> post-tag.
>
> Because noone's ever needed one before. If aliases can't do what you
> want, write a patch to support it and hope Junio accepts it. It's really
> quite straight-forward. Make sure you read Documentation/SubmittingPatches
> before you send it.
>
> Note though that use of tags on the developer's side will still be up
> to the developer and not something you can force through other means
> than policy or convention.

Being possible was never a reason to add features to git and the less it was
a reason to add hooks. And there does not seem to be a use-case that would
clearly benefit from having such hooks, or at least none was shown on the
list so far.

For integration with issue tracker, the local tag is neither final, nor
useful to anybody except the user who did it until it hits the central
repository. And working on the central repository directly does not seem like
a good idea either.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
       [not found]             ` <20081014172227.GB6931-hYs7FtC5zV+YSD4dQj0czg@public.gmane.org>
@ 2008-10-14 18:03               ` Kristis Makris
  2008-10-14 20:49                 ` Andreas Ericsson
                                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Kristis Makris @ 2008-10-14 18:03 UTC (permalink / raw)
  To: Jan Hudec
  Cc: Andreas Ericsson, scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ,
	git-u79uwXL29TY76Z2rM5mHXA, Jakub Narebski


[-- Attachment #1.1: Type: text/plain, Size: 4668 bytes --]

Jan, thanks for trying to clarify this for me.

I am working on adding integration support of Git with bug-trackers,
using Scmbug. There may be an argument here towards/against distributed
bug-trackers when it comes to Git.

Maybe there are things here I don't fully understand yet.

On Tue, 2008-10-14 at 19:22 +0200, Jan Hudec wrote:
> >>> Kristis Makris wrote:
> >>>> I want the integration when I apply the tag to a local repository, NOT
> >>>> only when I push/pull.
> 
> Care to explain why that would ever be useful? It's local, which means that:
>  - the user can take it back without a trace it ever happened (git tag -d or
>    even git update-ref -d) and
>  - noone except the user will see it anyway, so it's not like they should
>    care either.

I have two use cases:

(1) A developer maintains besides his local copy a local bug-tracking
system in which he tracks his changes. We would like to apply various
verification policies when he commits or tags. For example, for tagging
we wants to ensure that he tags giving consistent labels to his
intermediate builds. e.g. as in:

http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-CONVENTION-BASED-LABELING

Or he may want to have Git force him to also supply a log message along
with a tag, so that he can remember later more accurately why a tag was
created and what it really captures. Even if Git (or other SCM systems)
don't natively support log messages on tags. Scmbug plans to implement
this.

http://bugzilla.mkgnu.net/show_bug.cgi?id=219


(2) I would like to apply various verification policies when work from a
local repository is finally merged with the central repository. I assume
there can/will be a central repository, and there is one "software
product" that is being released somewhere among the many copies.

When its time to merge local changes to a central repository, the
verification policies may deem that changes are not acceptable to be
merged with the mainline. e.g. because log messages are too short,
commits during the merge are issued against bugs in "a central"
bugtracker that are either closed, assigned to someone else, or just
plain wrong bug-numbers that belong to other products:

http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-LOG-MESSAGE-SIZE
http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-OPEN-BUG-STATE
http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-BUG-OWNER
http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-PRODUCT-NAME

(I'm not very clear whether this is how Git works)

Does someone get to write-up a brand new log comment during the merge
and the merge totally disregards older log comments ? My understanding
is that log comments on the local copy are preserved (and will need to
be mapped to bug-numbers in the central bug-tracker. 

Thus the local verification policies may need to have already been
configured to comply with future verification policies of the central
repository. Else (perhaps considerable) mappings/adjustments will be
needed during the push to the central copy.

> Besides, you don't need git tag to create a tag in git, so the hook wouldn't
> really be guaranteed anyway (I mean, just like the commit hook is not -- you
> can still commit by calling write-tree, commit-tree and update-ref and avoid
> the hook).

I'm assuming someone who follows the recommended avenue of using Git
wants the advantages of hooks. I certainly can't force people that
bypass hooks to use them.

> For integration with issue tracker, the local tag is neither final, nor
> useful to anybody except the user who did it until it hits the central
> repository. And working on the central repository directly does not seem like
> a good idea either.

The local tag is useful to the local user and his local bug-tracker. He
can have tag operations intercepted so that the tag names show up as
versions in his bug-tracker. In this way he can keep track of which bugs
still exist or have recently been introduced/discovered to his local
copy, before he decides to publish his polished, final version:

http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#TAGS

And his "local bug-tracker" may be reachable on the web and useful by
others that take a peek at the users progress (even fetching it with
Git).


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 188 bytes --]

_______________________________________________
scmbug-users mailing list
scmbug-users-G8y9j4K4DsPiwOUmbS1EgQ@public.gmane.org
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-14 18:03               ` Kristis Makris
@ 2008-10-14 20:49                 ` Andreas Ericsson
  2008-10-14 21:33                 ` Daniel Barkalow
  2008-10-16 20:15                 ` Jan Hudec
  2 siblings, 0 replies; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-14 20:49 UTC (permalink / raw)
  To: Kristis Makris; +Cc: Jan Hudec, Jakub Narebski, git, scmbug-users

Kristis Makris wrote:
> Jan, thanks for trying to clarify this for me.
> 
> I am working on adding integration support of Git with bug-trackers,
> using Scmbug. There may be an argument here towards/against distributed
> bug-trackers when it comes to Git.
> 
> Maybe there are things here I don't fully understand yet.
> 
> On Tue, 2008-10-14 at 19:22 +0200, Jan Hudec wrote:
>>>>> Kristis Makris wrote:
>>>>>> I want the integration when I apply the tag to a local repository, NOT
>>>>>> only when I push/pull.
>> Care to explain why that would ever be useful? It's local, which means that:
>>  - the user can take it back without a trace it ever happened (git tag -d or
>>    even git update-ref -d) and
>>  - noone except the user will see it anyway, so it's not like they should
>>    care either.
> 
> I have two use cases:
> 
> (1) A developer maintains besides his local copy a local bug-tracking
> system in which he tracks his changes. We would like to apply various
> verification policies when he commits or tags. For example, for tagging
> we wants to ensure that he tags giving consistent labels to his
> intermediate builds. e.g. as in:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-CONVENTION-BASED-LABELING
> 

I'm guessing releases will be cut from some sort of central or official
repository anyway, so I fail to see why tags would need to be verified
at create-time rather than at push-time. It's sometimes useful to create
tags for ones own personal use, and commit messages that are no more than
"wip", without signoff or anything. This needs to be implemented at the
receiving end. Not at each developers end.

> Or he may want to have Git force him to also supply a log message along
> with a tag, so that he can remember later more accurately why a tag was
> created and what it really captures. Even if Git (or other SCM systems)
> don't natively support log messages on tags. Scmbug plans to implement
> this.
> 
> http://bugzilla.mkgnu.net/show_bug.cgi?id=219
> 

git supports optional log-messages on tags. There are two different kinds
of tags in git; "annotated" (with logmessage) and "lightweight" (without
logmessage). It's up to each user which sort of tag to create. Using the
example update hook, lightweight tags are by default not allowed to be
pushed to a repository.

> 
> (2) I would like to apply various verification policies when work from a
> local repository is finally merged with the central repository. I assume
> there can/will be a central repository, and there is one "software
> product" that is being released somewhere among the many copies.
> 

Merges happen in the local repository. When a merge is pushed to the
"release" repo, you can analyze the merges and all commits that the sender
is trying to push.

> When its time to merge local changes to a central repository, the
> verification policies may deem that changes are not acceptable to be
> merged with the mainline. e.g. because log messages are too short,
> commits during the merge are issued against bugs in "a central"
> bugtracker that are either closed, assigned to someone else, or just
> plain wrong bug-numbers that belong to other products:
> 

That sort of work belongs in the update hook then. Cautious users, or
release engineers, might want to enable pre-merge hooks and whatnot.

> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-LOG-MESSAGE-SIZE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-OPEN-BUG-STATE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-BUG-OWNER
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-PRODUCT-NAME
> 
> (I'm not very clear whether this is how Git works)
> 
> Does someone get to write-up a brand new log comment during the merge
> and the merge totally disregards older log comments ? My understanding
> is that log comments on the local copy are preserved (and will need to
> be mapped to bug-numbers in the central bug-tracker. 
> 

Try and find out. It would have been faster than writing that paragraph ;-)

> Thus the local verification policies may need to have already been
> configured to comply with future verification policies of the central
> repository. Else (perhaps considerable) mappings/adjustments will be
> needed during the push to the central copy.
> 
>> Besides, you don't need git tag to create a tag in git, so the hook wouldn't
>> really be guaranteed anyway (I mean, just like the commit hook is not -- you
>> can still commit by calling write-tree, commit-tree and update-ref and avoid
>> the hook).
> 
> I'm assuming someone who follows the recommended avenue of using Git
> wants the advantages of hooks. I certainly can't force people that
> bypass hooks to use them.
> 

Hooks can also be disabled, and they aren't enabled by default. They're also
not cloned along with a repository (that would be stupid, as I most certainly
don't want the email-on-commit hooks we're using at work), so installing
said hooks would still be a manual job done by each developer that wishes to
comply with the policy you're outlining. I have a hard time seeing how that
can benefit the open community.

>> For integration with issue tracker, the local tag is neither final, nor
>> useful to anybody except the user who did it until it hits the central
>> repository. And working on the central repository directly does not seem like
>> a good idea either.
> 
> The local tag is useful to the local user and his local bug-tracker. He
> can have tag operations intercepted so that the tag names show up as
> versions in his bug-tracker. In this way he can keep track of which bugs
> still exist or have recently been introduced/discovered to his local
> copy, before he decides to publish his polished, final version:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#TAGS
> 
> And his "local bug-tracker" may be reachable on the web and useful by
> others that take a peek at the users progress (even fetching it with
> Git).
> 

Relying on hooks on the developer side is fragile and *will* break.
It will break often, and it will break badly. Any sort of
"this-commit-is-releasable" verification simply *has* to be done in
the release repository. Otherwise you'll be limiting how devs can
use the scm while gaining absolutely nothing (since it has to be
done in the release repo too for those times when the dev forgot
to enable hook X in a newly cloned repository).

I still haven't figured out what the over-all plan is, so my
advice and warnings may be counter-productive at worst. However,
http://files.mkgnu.net/files/scmbug/doc/latest_manual/html-multi/x113.html
just doesn't make sense to me. It's invalidated by clear and
concise commit messages (which aren't always there, but education
is nine times out of ten better than enforcement; It's better
to understand *why* 6x7 = 42 rather than just knowing that it's
so).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-14 18:03               ` Kristis Makris
  2008-10-14 20:49                 ` Andreas Ericsson
@ 2008-10-14 21:33                 ` Daniel Barkalow
  2008-10-16 20:15                 ` Jan Hudec
  2 siblings, 0 replies; 15+ messages in thread
From: Daniel Barkalow @ 2008-10-14 21:33 UTC (permalink / raw)
  To: Kristis Makris
  Cc: Jan Hudec, Andreas Ericsson, Jakub Narebski, git, scmbug-users

On Tue, 14 Oct 2008, Kristis Makris wrote:

> Jan, thanks for trying to clarify this for me.
> 
> I am working on adding integration support of Git with bug-trackers,
> using Scmbug. There may be an argument here towards/against distributed
> bug-trackers when it comes to Git.
> 
> Maybe there are things here I don't fully understand yet.
> 
> On Tue, 2008-10-14 at 19:22 +0200, Jan Hudec wrote:
> > >>> Kristis Makris wrote:
> > >>>> I want the integration when I apply the tag to a local repository, NOT
> > >>>> only when I push/pull.
> > 
> > Care to explain why that would ever be useful? It's local, which means that:
> >  - the user can take it back without a trace it ever happened (git tag -d or
> >    even git update-ref -d) and
> >  - noone except the user will see it anyway, so it's not like they should
> >    care either.
> 
> I have two use cases:
> 
> (1) A developer maintains besides his local copy a local bug-tracking
> system in which he tracks his changes. We would like to apply various
> verification policies when he commits or tags. For example, for tagging
> we wants to ensure that he tags giving consistent labels to his
> intermediate builds. e.g. as in:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-CONVENTION-BASED-LABELING
> 
> Or he may want to have Git force him to also supply a log message along
> with a tag, so that he can remember later more accurately why a tag was
> created and what it really captures. Even if Git (or other SCM systems)
> don't natively support log messages on tags. Scmbug plans to implement
> this.

Git supports using tags for a variety of other purposes in addition to the 
traditional ones (for example, you can tag a version as "the changes I'm 
sure of" or "the version I know is broken"; furthermore, your regression 
testing system could give you a tag that tags the commit you sent for 
testing with the test results). The bug tracker integration should only 
care about the traditional use (providing a persistant, human-recognizable 
name for a revision). Actually, it would probably be best, for integration 
with git, to skip tags entirely, and use the hash. With projects using 
git, it is routine to know that the bug was found in some particular 
flawed commit that didn't get tagged.

> http://bugzilla.mkgnu.net/show_bug.cgi?id=219
> 
> 
> (2) I would like to apply various verification policies when work from a
> local repository is finally merged with the central repository. I assume
> there can/will be a central repository, and there is one "software
> product" that is being released somewhere among the many copies.
> 
> When its time to merge local changes to a central repository, the
> verification policies may deem that changes are not acceptable to be
> merged with the mainline. e.g. because log messages are too short,
> commits during the merge are issued against bugs in "a central"
> bugtracker that are either closed, assigned to someone else, or just
> plain wrong bug-numbers that belong to other products:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-LOG-MESSAGE-SIZE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-OPEN-BUG-STATE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-BUG-OWNER
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-PRODUCT-NAME
> 
> (I'm not very clear whether this is how Git works)
> 
> Does someone get to write-up a brand new log comment during the merge
> and the merge totally disregards older log comments ? My understanding
> is that log comments on the local copy are preserved (and will need to
> be mapped to bug-numbers in the central bug-tracker. 

In general, you send to the central repository, and it rejects you if (a) 
a merge would be required; you have to fetch and merge in your local 
repository; or (b) there's something wrong with the changes you're making.

For (a), you make a merge commit and try again; the new commit has a log 
message, but the old commits retain their log messages. For (b), you make 
a different set of commits that does follow the required policy. "git 
rebase -i origin/master" will guide you through this process. In general, 
you do this before sharing your changes with anybody else, or at least 
before sharing them with anyone who cares about the end result, so that 
other people see nice commits. It's also possible to rearrange the changes 
you made in a bunch of local commits into a series that looks nice and 
makes sense and follows the project rules, when your initial work had you 
introducing a lot of silly mistakes and fixing them.

> Thus the local verification policies may need to have already been
> configured to comply with future verification policies of the central
> repository. Else (perhaps considerable) mappings/adjustments will be
> needed during the push to the central copy.

In general, there's a ton of adjustment needed between working on a 
project and pushing to the central location in any system. With git, 
however, version control may be used locally before these adjustments are 
made, and this provides a huge benefit in terms of being able to prepare 
commits just how they should be, and in terms of being able to avoid 
losing work during the adjustments.

In general, you want to have a local understanding of the central 
repository rules, so that you can do this mapping while you don't have 
network, but there's no reason to prevent saving your work before it 
conforms.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-14 18:03               ` Kristis Makris
  2008-10-14 20:49                 ` Andreas Ericsson
  2008-10-14 21:33                 ` Daniel Barkalow
@ 2008-10-16 20:15                 ` Jan Hudec
  2008-10-17  7:04                   ` Andreas Ericsson
  2 siblings, 1 reply; 15+ messages in thread
From: Jan Hudec @ 2008-10-16 20:15 UTC (permalink / raw)
  To: Kristis Makris; +Cc: Andreas Ericsson, Jakub Narebski, git, scmbug-users

On Tue, Oct 14, 2008 at 11:03:21 -0700, Kristis Makris wrote:
> I have two use cases:
> 
> (1) A developer maintains besides his local copy a local bug-tracking
> system in which he tracks his changes. We would like to apply various
> verification policies when he commits or tags. For example, for tagging
> we wants to ensure that he tags giving consistent labels to his
> intermediate builds. e.g. as in:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-CONVENTION-BASED-LABELING

That already requires using additional interface to git alone. Using an alias
for creating tags that are synchronized with that local bug-tracker is not
that much more complex than IMHO. Besides you will sometimes want to use git
tags, branches, commits and other things *without* synchronizing them to the
local bug-tracker even if you usually synchronize -- they are often very
useful for manipulating changes.

> Or he may want to have Git force him to also supply a log message along
> with a tag, so that he can remember later more accurately why a tag was
> created and what it really captures. Even if Git (or other SCM systems)
> don't natively support log messages on tags. Scmbug plans to implement
> this.
> 
> http://bugzilla.mkgnu.net/show_bug.cgi?id=219

Git does support log messages on tags. It has unannotated tags (which are
just refs) and annotated tags which have a special tag object with the log
message (and optionally PGP signature).

> (2) I would like to apply various verification policies when work from a
> local repository is finally merged with the central repository. I assume
> there can/will be a central repository, and there is one "software
> product" that is being released somewhere among the many copies.
> 
> When its time to merge local changes to a central repository, the
> verification policies may deem that changes are not acceptable to be
> merged with the mainline. e.g. because log messages are too short,
> commits during the merge are issued against bugs in "a central"
> bugtracker that are either closed, assigned to someone else, or just
> plain wrong bug-numbers that belong to other products:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-LOG-MESSAGE-SIZE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-OPEN-BUG-STATE
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-BUG-OWNER
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#VERIFICATION-CHECKS-VALID-PRODUCT-NAME
> 
> (I'm not very clear whether this is how Git works)
> 
> Does someone get to write-up a brand new log comment during the merge
> and the merge totally disregards older log comments? My understanding
> is that log comments on the local copy are preserved (and will need to
> be mapped to bug-numbers in the central bug-tracker. 

Indeed, the locally made commits are transfered to the upstream repository as
they are. In fact, because the commit id is a SHA1 checksum of all it's
content, including the message and the parent ids (and therefore complete
history), when the commit message is changed, it is no longer the same
commit.

However, git provides many tools (commit --amend, rebase -i, filter-branch)
and has additional extensions (stgit, topgit), that make it easy to create
a new commit based on another one with some change. This is extremely useful
and many people use it really often.

Such new commit will not replace the previous one -- it has different
checksum -- so it's not good thing to do when other people already based
further changes on your commit. But it's very useful for handling work in
progress, quickly diverting to different tasks, making experiments and such.

Therefore it's the push that casts things in stone, but before that you can
easily take back and redo both commits and tags. Additionally it's very
useful to sometimes do commits and tags that you intend to replace later just
to temporarily record some interesting state eg. to divert to other bug that
suddenly got higher priority or to try out different approach.

Thus you only want to run the checks as warnings locally and probably want to
have an option to avoid them in a particular case for performance reasons
(all this stuff is so useful because it's fast). And since the tags that are
ment for publication you will usually pull shortly after making them and
because creating a tag is rather simple, I would say that running the check
on push is sufficient there and the alias helps if you'd really want to run
the check earlier. For commits you can of course use the pre-commit and
post-commit hooks.

> [...]
> The local tag is useful to the local user and his local bug-tracker. He
> can have tag operations intercepted so that the tag names show up as
> versions in his bug-tracker. In this way he can keep track of which bugs
> still exist or have recently been introduced/discovered to his local
> copy, before he decides to publish his polished, final version:
> 
> http://files.mkgnu.net/files/scmbug/SCMBUG_RELEASE_0-26-9/manual/html-single/manual.html#TAGS
> 
> And his "local bug-tracker" may be reachable on the web and useful by
> others that take a peek at the users progress (even fetching it with
> Git).

I would rather recommend having per-developer branches (you can actually have
branch hierarchies, so it's rather per-developer branch directories) on the
central repo, where the users would push their work they consider final
enough to show to anybody. Than you can have a "pending" (or "for review" or
both or whatever) state in the central bug-tracker for issues with fixes on
such developer branches. That saves the hassle of installing per-developer
trackers and gives developer more freedom to create temporary stuff locally.

That is not to say that your use case makes no sense. I am just trying to
suggest a workflow, that might fit better with the existing practices used
with git and maybe requiring less work to implement.

As for people replacing their local commits, this is common especially in
Linux (and Git) development model. For Linux patches need to be sent split
into logical steps to make it easier to review them, which is quite important
for a critical piece of code like kernel. But everybody will inevitably make
mistakes when implementing the changes; these mistakes must not appear in the
final submission though, because they would interfere with review. When
developing in Git, each commit will produce one patch in the submission, so
people go and redo their commits multiple times to make them as much readable
as possible and fix bugs they made earlier.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Git and tagging hook
  2008-10-16 20:15                 ` Jan Hudec
@ 2008-10-17  7:04                   ` Andreas Ericsson
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Ericsson @ 2008-10-17  7:04 UTC (permalink / raw)
  To: Jan Hudec; +Cc: Kristis Makris, Jakub Narebski, git

Jan Hudec wrote:
> As for people replacing their local commits, this is common especially in
> Linux (and Git) development model.

It's common everywhere where projects use peer review.

Results 1 - 50 of about 14,600 for '"PATCH v2" vger.kernel.org'
Results 1 - 50 of about 360,000 for "PATCH v2"

So yes, it is a very common practice and anything interacting with a remote
database based on each commit action will almost certainly be doing something
wrong quite a lot of the time, especially since not all the patch-series end
up being incorporated into a release anyway.

The only sane integration point is the public watering-hole repository used
for the project, and especially the release branch (or the "for-linus" branches
around the world for sub-projects).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-10-17  7:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06  4:45 Git and tagging hook Kristis Makris
2008-10-06  7:17 ` Andreas Ericsson
2008-10-07 17:13   ` Kristis Makris
2008-10-07 17:28     ` Jakub Narebski
2008-10-08 16:47       ` Kristis Makris
2008-10-08 17:40         ` Andreas Ericsson
2008-10-14 17:22           ` Jan Hudec
     [not found]             ` <20081014172227.GB6931-hYs7FtC5zV+YSD4dQj0czg@public.gmane.org>
2008-10-14 18:03               ` Kristis Makris
2008-10-14 20:49                 ` Andreas Ericsson
2008-10-14 21:33                 ` Daniel Barkalow
2008-10-16 20:15                 ` Jan Hudec
2008-10-17  7:04                   ` Andreas Ericsson
2008-10-06  7:20 ` Andreas Ericsson
2008-10-07 17:30   ` Kristis Makris
2008-10-08  6:12     ` Andreas Ericsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).