You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Ashutosh Chauhan <ha...@apache.org> on 2015/07/10 20:08:18 UTC

[Discuss] Patch submission and commit format

There was a problem of attributing contributions correctly back when we
were using svn, now that we are on git, that problem can be addressed. This
email is an effort to solicit feedback for it.

Problem: In svn, there is only a committer field, so when committer was
committing someone else's patch there was no way in svn to record original
contributor. We used to workaround this by putting name of contributor in
commit message.

Git offers a better solution for this, since it makes a distinction between
committer and author of the patch. However, to do this git needs patch to
be formatted (with git format-patch) and committed (using git am) in
certain way. I myself is using following flags to generate and commit
patches for some time now:

git format-patch --stdout -1 > HIVE-XXXXX.patch
git am --signoff HIVE-XXXXX.patch

I propose we follow these conventions to generate and commit patches.
Thoughts?

Ashutosh

PS: Motivation for this came while lurking on linux kernel mailing list,
where I found Linux devs follow similar process.

Re: [Discuss] Patch submission and commit format

Posted by Lefty Leverenz <le...@gmail.com>.
What happens if someone doesn't follow the conventions?  Can they be
enforced automatically?

-- Lefty

On Fri, Jul 10, 2015 at 2:23 PM, Prasanth Jayachandran <
pjayachandran@hortonworks.com> wrote:

> Great idea. Definitely we should attribute the contributions from the
> author in a better way. +1.
> We should update the docs on “How to Contribute?” to generate the patch
> using format-path.
>
> > On Jul 10, 2015, at 11:08 AM, Ashutosh Chauhan <ha...@apache.org>
> wrote:
> >
> > There was a problem of attributing contributions correctly back when we
> > were using svn, now that we are on git, that problem can be addressed.
> This
> > email is an effort to solicit feedback for it.
> >
> > Problem: In svn, there is only a committer field, so when committer was
> > committing someone else's patch there was no way in svn to record
> original
> > contributor. We used to workaround this by putting name of contributor in
> > commit message.
> >
> > Git offers a better solution for this, since it makes a distinction
> between
> > committer and author of the patch. However, to do this git needs patch to
> > be formatted (with git format-patch) and committed (using git am) in
> > certain way. I myself is using following flags to generate and commit
> > patches for some time now:
> >
> > git format-patch --stdout -1 > HIVE-XXXXX.patch
> > git am --signoff HIVE-XXXXX.patch
> >
> > I propose we follow these conventions to generate and commit patches.
> > Thoughts?
> >
> > Ashutosh
> >
> > PS: Motivation for this came while lurking on linux kernel mailing list,
> > where I found Linux devs follow similar process.
>
>

Re: [Discuss] Patch submission and commit format

Posted by Prasanth Jayachandran <pj...@hortonworks.com>.
Great idea. Definitely we should attribute the contributions from the author in a better way. +1.
We should update the docs on “How to Contribute?” to generate the patch using format-path.

> On Jul 10, 2015, at 11:08 AM, Ashutosh Chauhan <ha...@apache.org> wrote:
> 
> There was a problem of attributing contributions correctly back when we
> were using svn, now that we are on git, that problem can be addressed. This
> email is an effort to solicit feedback for it.
> 
> Problem: In svn, there is only a committer field, so when committer was
> committing someone else's patch there was no way in svn to record original
> contributor. We used to workaround this by putting name of contributor in
> commit message.
> 
> Git offers a better solution for this, since it makes a distinction between
> committer and author of the patch. However, to do this git needs patch to
> be formatted (with git format-patch) and committed (using git am) in
> certain way. I myself is using following flags to generate and commit
> patches for some time now:
> 
> git format-patch --stdout -1 > HIVE-XXXXX.patch
> git am --signoff HIVE-XXXXX.patch
> 
> I propose we follow these conventions to generate and commit patches.
> Thoughts?
> 
> Ashutosh
> 
> PS: Motivation for this came while lurking on linux kernel mailing list,
> where I found Linux devs follow similar process.


Re: [Discuss] Patch submission and commit format

Posted by Sergio Pena <se...@cloudera.com>.
I like this idea of the commit format.

Maybe we could use some git hooks to enforce a commit to be in a specific
format and to have a contributor too.

I found this article about git hooks we can use on the server-side to
enforce this:
https://www.atlassian.com/git/tutorials/git-hooks
https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy

- Sergio

On Fri, Jul 10, 2015 at 1:59 PM, Sergey Shelukhin <se...@hortonworks.com>
wrote:

> The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
> reviewed by John Smith)” or something like that in the commit message.
> I think the new approach is better… +1
> Can you create a detailed instruction?
> Is it enforceable in git?
>
> On 15/7/10, 11:08, "Ashutosh Chauhan" <ha...@apache.org> wrote:
>
> >There was a problem of attributing contributions correctly back when we
> >were using svn, now that we are on git, that problem can be addressed.
> >This
> >email is an effort to solicit feedback for it.
> >
> >Problem: In svn, there is only a committer field, so when committer was
> >committing someone else's patch there was no way in svn to record original
> >contributor. We used to workaround this by putting name of contributor in
> >commit message.
> >
> >Git offers a better solution for this, since it makes a distinction
> >between
> >committer and author of the patch. However, to do this git needs patch to
> >be formatted (with git format-patch) and committed (using git am) in
> >certain way. I myself is using following flags to generate and commit
> >patches for some time now:
> >
> >git format-patch --stdout -1 > HIVE-XXXXX.patch
> >git am --signoff HIVE-XXXXX.patch
> >
> >I propose we follow these conventions to generate and commit patches.
> >Thoughts?
> >
> >Ashutosh
> >
> >PS: Motivation for this came while lurking on linux kernel mailing list,
> >where I found Linux devs follow similar process.
>
>

Re: [Discuss] Patch submission and commit format

Posted by Thejas Nair <th...@gmail.com>.
The one from git format-patch would have an header which looks like an
email header -
For example -

>From 1a1c0d817da036025f1c3b953af7b52403c048ba Mon Sep 17 00:00:00 2001
From: Alan Gates <ga...@horton...>
Date: Wed, 1 Jul 2015 15:47:03 -0700
Subject: [PATCH] HIVE-11061 Table renames not propagated to partition table
in
 HBase metastore (gates)


On Thu, Jul 16, 2015 at 8:10 AM, Alan Gates <al...@gmail.com> wrote:

> When we are committing another's patch is there an easy way to tell
> whether they properly generated via git format-patch or another method?
>
> Alan.
>
>   Thejas Nair <th...@gmail.com>
>  July 14, 2015 at 10:56
> In case the patch is generated using a simple git-diff or another
> method that is not of same format as git format-patch , you can use
> the following command to commit with attribution -
>
> git commit -a -m ' … ' --author="Name of the author"
>
> I verified that it shows the attribution after the commit -
> git show --pretty=email head
> From b75633f9b2c003bff2c87db5e67c7690ffb37bf8 Mon Sep 17 00:00:00 2001
> From: Pengcheng Xiong <px...@hort...> <px...@hort...>
> Date: Tue, 14 Jul 2015 10:46:30 -0700
> Subject: [PATCH] HIVE-11224 : AggregateStatsCache triggers
> ...
>
>
> On Mon, Jul 13, 2015 at 9:38 AM, Ashutosh Chauhan
>   Ashutosh Chauhan <as...@gmail.com>
>  July 13, 2015 at 9:38
> @Lefty : Nothing happens if someone doesn't follow convention. I don't know
> if this can be enforced automatically.
> @Sergey : I don't know enough git to answer that. If someone can make this
> enforceable that will be good, but its not required.
>
> Others,
> Seems like there is an agreement here. I will update wiki with instructions
> soon.
>
> Thanks,
> Ashutosh
>
> On Fri, Jul 10, 2015 at 11:59 AM, Sergey Shelukhin
> <se...@hortonworks.com> <se...@hortonworks.com>
>
>   Sergey Shelukhin <se...@hortonworks.com>
>  July 10, 2015 at 11:59
> The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
> reviewed by John Smith)” or something like that in the commit message.
> I think the new approach is better… +1
> Can you create a detailed instruction?
> Is it enforceable in git?
>
>
>   Ashutosh Chauhan <ha...@apache.org>
>  July 10, 2015 at 11:08
> There was a problem of attributing contributions correctly back when we
> were using svn, now that we are on git, that problem can be addressed. This
> email is an effort to solicit feedback for it.
>
> Problem: In svn, there is only a committer field, so when committer was
> committing someone else's patch there was no way in svn to record original
> contributor. We used to workaround this by putting name of contributor in
> commit message.
>
> Git offers a better solution for this, since it makes a distinction between
> committer and author of the patch. However, to do this git needs patch to
> be formatted (with git format-patch) and committed (using git am) in
> certain way. I myself is using following flags to generate and commit
> patches for some time now:
>
> git format-patch --stdout -1 > HIVE-XXXXX.patch
> git am --signoff HIVE-XXXXX.patch
>
> I propose we follow these conventions to generate and commit patches.
> Thoughts?
>
> Ashutosh
>
> PS: Motivation for this came while lurking on linux kernel mailing list,
> where I found Linux devs follow similar process.
>
>

Re: [Discuss] Patch submission and commit format

Posted by Alan Gates <al...@gmail.com>.
When we are committing another's patch is there an easy way to tell 
whether they properly generated via git format-patch or another method?

Alan.

> Thejas Nair <ma...@gmail.com>
> July 14, 2015 at 10:56
> In case the patch is generated using a simple git-diff or another
> method that is not of same format as git format-patch , you can use
> the following command to commit with attribution -
>
> git commit -a -m ' … ' --author="Name of the author"
>
> I verified that it shows the attribution after the commit -
> git show --pretty=email head
> From b75633f9b2c003bff2c87db5e67c7690ffb37bf8 Mon Sep 17 00:00:00 2001
> From: Pengcheng Xiong <px...@hort...>
> Date: Tue, 14 Jul 2015 10:46:30 -0700
> Subject: [PATCH] HIVE-11224 : AggregateStatsCache triggers
> ...
>
>
> On Mon, Jul 13, 2015 at 9:38 AM, Ashutosh Chauhan
> Ashutosh Chauhan <ma...@gmail.com>
> July 13, 2015 at 9:38
> @Lefty : Nothing happens if someone doesn't follow convention. I don't 
> know
> if this can be enforced automatically.
> @Sergey : I don't know enough git to answer that. If someone can make this
> enforceable that will be good, but its not required.
>
> Others,
> Seems like there is an agreement here. I will update wiki with 
> instructions
> soon.
>
> Thanks,
> Ashutosh
>
> On Fri, Jul 10, 2015 at 11:59 AM, Sergey Shelukhin 
> <se...@hortonworks.com>
>
> Sergey Shelukhin <ma...@hortonworks.com>
> July 10, 2015 at 11:59
> The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
> reviewed by John Smith)” or something like that in the commit message.
> I think the new approach is better… +1
> Can you create a detailed instruction?
> Is it enforceable in git?
>
>
> Ashutosh Chauhan <ma...@apache.org>
> July 10, 2015 at 11:08
> There was a problem of attributing contributions correctly back when we
> were using svn, now that we are on git, that problem can be addressed. 
> This
> email is an effort to solicit feedback for it.
>
> Problem: In svn, there is only a committer field, so when committer was
> committing someone else's patch there was no way in svn to record original
> contributor. We used to workaround this by putting name of contributor in
> commit message.
>
> Git offers a better solution for this, since it makes a distinction 
> between
> committer and author of the patch. However, to do this git needs patch to
> be formatted (with git format-patch) and committed (using git am) in
> certain way. I myself is using following flags to generate and commit
> patches for some time now:
>
> git format-patch --stdout -1 > HIVE-XXXXX.patch
> git am --signoff HIVE-XXXXX.patch
>
> I propose we follow these conventions to generate and commit patches.
> Thoughts?
>
> Ashutosh
>
> PS: Motivation for this came while lurking on linux kernel mailing list,
> where I found Linux devs follow similar process.
>

Re: [Discuss] Patch submission and commit format

Posted by Thejas Nair <th...@gmail.com>.
In case the patch is generated using a simple git-diff or another
method that is not of same format as git format-patch , you can use
the following command to commit with attribution -

git commit -a -m ' … ' --author="Name of the author"

I verified that it shows the attribution after the commit -
git  show --pretty=email  head
>From b75633f9b2c003bff2c87db5e67c7690ffb37bf8 Mon Sep 17 00:00:00 2001
From: Pengcheng Xiong <px...@hort...>
Date: Tue, 14 Jul 2015 10:46:30 -0700
Subject: [PATCH] HIVE-11224 :  AggregateStatsCache triggers
...


On Mon, Jul 13, 2015 at 9:38 AM, Ashutosh Chauhan
<as...@gmail.com> wrote:
> @Lefty : Nothing happens if someone doesn't follow convention. I don't know
> if this can be enforced automatically.
> @Sergey : I don't know enough git to answer that. If someone can make this
> enforceable that will be good, but its not required.
>
> Others,
> Seems like there is an agreement here. I will update wiki with instructions
> soon.
>
> Thanks,
> Ashutosh
>
> On Fri, Jul 10, 2015 at 11:59 AM, Sergey Shelukhin <se...@hortonworks.com>
> wrote:
>
>> The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
>> reviewed by John Smith)” or something like that in the commit message.
>> I think the new approach is better… +1
>> Can you create a detailed instruction?
>> Is it enforceable in git?
>>
>> On 15/7/10, 11:08, "Ashutosh Chauhan" <ha...@apache.org> wrote:
>>
>> >There was a problem of attributing contributions correctly back when we
>> >were using svn, now that we are on git, that problem can be addressed.
>> >This
>> >email is an effort to solicit feedback for it.
>> >
>> >Problem: In svn, there is only a committer field, so when committer was
>> >committing someone else's patch there was no way in svn to record original
>> >contributor. We used to workaround this by putting name of contributor in
>> >commit message.
>> >
>> >Git offers a better solution for this, since it makes a distinction
>> >between
>> >committer and author of the patch. However, to do this git needs patch to
>> >be formatted (with git format-patch) and committed (using git am) in
>> >certain way. I myself is using following flags to generate and commit
>> >patches for some time now:
>> >
>> >git format-patch --stdout -1 > HIVE-XXXXX.patch
>> >git am --signoff HIVE-XXXXX.patch
>> >
>> >I propose we follow these conventions to generate and commit patches.
>> >Thoughts?
>> >
>> >Ashutosh
>> >
>> >PS: Motivation for this came while lurking on linux kernel mailing list,
>> >where I found Linux devs follow similar process.
>>
>>

Re: [Discuss] Patch submission and commit format

Posted by Ashutosh Chauhan <as...@gmail.com>.
@Lefty : Nothing happens if someone doesn't follow convention. I don't know
if this can be enforced automatically.
@Sergey : I don't know enough git to answer that. If someone can make this
enforceable that will be good, but its not required.

Others,
Seems like there is an agreement here. I will update wiki with instructions
soon.

Thanks,
Ashutosh

On Fri, Jul 10, 2015 at 11:59 AM, Sergey Shelukhin <se...@hortonworks.com>
wrote:

> The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
> reviewed by John Smith)” or something like that in the commit message.
> I think the new approach is better… +1
> Can you create a detailed instruction?
> Is it enforceable in git?
>
> On 15/7/10, 11:08, "Ashutosh Chauhan" <ha...@apache.org> wrote:
>
> >There was a problem of attributing contributions correctly back when we
> >were using svn, now that we are on git, that problem can be addressed.
> >This
> >email is an effort to solicit feedback for it.
> >
> >Problem: In svn, there is only a committer field, so when committer was
> >committing someone else's patch there was no way in svn to record original
> >contributor. We used to workaround this by putting name of contributor in
> >commit message.
> >
> >Git offers a better solution for this, since it makes a distinction
> >between
> >committer and author of the patch. However, to do this git needs patch to
> >be formatted (with git format-patch) and committed (using git am) in
> >certain way. I myself is using following flags to generate and commit
> >patches for some time now:
> >
> >git format-patch --stdout -1 > HIVE-XXXXX.patch
> >git am --signoff HIVE-XXXXX.patch
> >
> >I propose we follow these conventions to generate and commit patches.
> >Thoughts?
> >
> >Ashutosh
> >
> >PS: Motivation for this came while lurking on linux kernel mailing list,
> >where I found Linux devs follow similar process.
>
>

Re: [Discuss] Patch submission and commit format

Posted by Sergey Shelukhin <se...@hortonworks.com>.
The existing approach appears to be “HIVE-XXXXX : fix the bugs (John Doe,
reviewed by John Smith)” or something like that in the commit message.
I think the new approach is better… +1
Can you create a detailed instruction?
Is it enforceable in git?

On 15/7/10, 11:08, "Ashutosh Chauhan" <ha...@apache.org> wrote:

>There was a problem of attributing contributions correctly back when we
>were using svn, now that we are on git, that problem can be addressed.
>This
>email is an effort to solicit feedback for it.
>
>Problem: In svn, there is only a committer field, so when committer was
>committing someone else's patch there was no way in svn to record original
>contributor. We used to workaround this by putting name of contributor in
>commit message.
>
>Git offers a better solution for this, since it makes a distinction
>between
>committer and author of the patch. However, to do this git needs patch to
>be formatted (with git format-patch) and committed (using git am) in
>certain way. I myself is using following flags to generate and commit
>patches for some time now:
>
>git format-patch --stdout -1 > HIVE-XXXXX.patch
>git am --signoff HIVE-XXXXX.patch
>
>I propose we follow these conventions to generate and commit patches.
>Thoughts?
>
>Ashutosh
>
>PS: Motivation for this came while lurking on linux kernel mailing list,
>where I found Linux devs follow similar process.