Hi there,

On Tue, 2015-11-03 at 22:39 -0800, Marc Herbert wrote:
> Hi,
> 
> > > maybe just put it after the last found tag or at the end if no
> > > tag is found.
> 
> The term "tag" is such a poor choice here... I realize it's not your
> choice, but it does not seem universal either: is there some
> alternative term you could use in the code?
> 

I don't know of an alternative name.

> > It traditionally goes at the top. This is where gerrit looks for
> > it, and I'm not entirely sure that it will work properly if it goes
> > elsewhere.
> 
> https://gerrit-review.googlesource.com/Documentation/user-changeid.ht
> ml
> "To be picked up by Gerrit, a Change-Id line must be in the footer
> (last paragraph) of a commit message"
> This documentation is confirmed by experience: it does not matter
> where exactly in the last paragraph as long as it's there.
> 

Yes, the gerrit server does not, but generally the commit hook placed
it at the top, and this is the standard I was trying to follow. I find
it to be most readable at the top.

> By the way this URL could make a good addition if you're looking for
> one.

Yes.

> 
> 
> > I am attempting to encode the same behavior as the gerrit git
> > -commit hook.
> 
> As a general comment: this series looks to me like a fairly large
> change and number of lines for merely duplicating a relatively simple
> and not universally used feature... wouldn't running a
> --run-commit-hook option offer much more with less code?
> 

The issue with "run-commit-hook" is *not* simple. The main issue is
figuring out where to actually run the hook. The largest issue is
preserving semantics of the hooks so that a hook which works on git
will work when using stgit. I couldn't find a place to do this. The
issue is that we generate new commits in an entirely different way. We
also have the notion of the stack and figuring out how to make it so
that all the data for the commit is setup so that gerrit commit-hook
can run safely and get the same information to generate the Change-Id
is not easy.

I would much prefer this route, but I didn't have the time or knowledge
of stgit codebase to actually get it working. This was what I tried to
do first, but gave up due to the vast difference with how stgit and git
generate new commits.

> 
> >  The block of tags comes after the description and ideally should
> > have a complete blank line above them ("\n\n", basically)
> 
> The structure is not always that simple, see some real-world examples
> here:
> https://chromium-review.googlesource.com/302513
> https://chromium-review.googlesource.com/298212
> 
> 

Note that even in the above, yes they have multiple "blocks" of tags,
but the only one that most tools will recognize is the last one, which
does infact have a blank line preceding it.

If you could provide some help to get run-commit-hooks working I would
much vastly prefer this. An alternative is to provide our own mechanism
for doing this, as well, but this seems at least as complicated.

Regards,
Jake

> Marc
_______________________________________________
stgit-users mailing list
[email protected]
https://mail.gna.org/listinfo/stgit-users

Reply via email to