Re: Please avoid noisy merge commits in frameworks

2012-02-21 Thread Thomas Zander
söndagen den 19 februari 2012 14.36.07 skrev  Stephen Kelly:
> I was reviewing the changes in the frameworks branch from yesterday. 
> Something I noticed was that there are a lot of merge commits that don't 
> need to exist.

Heh, sounds familiar, the same thing was brought up when Qt switched to Git :)

I think the following simple rule should be presented to committers, but in 
general these merges can be ignored in listings so its a problem that can be 
solved on both sides.

Now the rule;
  If you have done commmits and *no* branching work at all, you should 
  pull using;
  "git pull --rebase"

The 'no branching work' is what 90% of the contributors will do, they just 
work on one branch all the time.
-- 
Thomas Zander
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-21 Thread Ben Cooksley
On Feb 20, 2012 7:12 AM, "Stephen Kelly"  wrote:
>
> Dario Freddi wrote:
>
> > 2012/2/19 Stephen Kelly :
> >> Stephen Kelly wrote:
> >>
> >>>
> >>> Hi there,
> >>>
> >>> I was reviewing the changes in the frameworks branch from yesterday.
> >>> Something I noticed was that there are a lot of merge commits that
don't
> >>> need to exist.
> >>
> >> Ugh. Yet more of this just appeared... Recent history in the frameworks
> >> branch looks far more complex than it is and is harder to follow.
> >>
> >> There are too many people unaware that they're doing it maybe...
> >
> > What about having a small volunteer day in which we draft some
> > policies for git commits and eventually implement some hooks to avoid
> > these (and other) things happening?
> >
>
> There's some ideas for such hooks on the Internet already:
>
> http://stackoverflow.com/questions/2039773/have-remote-git-repository-
> refuse-merge-commits-on-push
>
> I don't know ruby or shell scripting well enough to write something
sysadmin
> would accept, but I would definitely welcome such a hook.

First, our hooks are in python - so any changes would need to be in Python
as well.

Second, there is a legitimate use for pushing merge commits - namely
integrating a seperate remote branch. I have no idea if it would be
possible to determine if this is a local only branch merge or not.

Third, please ensure that you disable the previously mentioned auto-rebase
on git pull if you are merging a reemote branch, otherwise you will
duplicate many commits, in addition to triggering the hooks for all those
commits (which will not happen if you just merge). The hooks could even
decide to reject your push, as it will contain too many new commits.

>
> Thanks,
>
> Steve.
>
>

Regards,
Ben Cooksley
KDE Sysadmin.
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-21 Thread Matt Williams
On 19 February 2012 13:36, Stephen Kelly  wrote:
>
> Hi there,
>
> I was reviewing the changes in the frameworks branch from yesterday.
> Something I noticed was that there are a lot of merge commits that don't
> need to exist.
>
> Please use `gitk` to see them.
>
> The unneeded merge commits actually make it harder to follow frameworks for
> me. It breaks things like using `gitk --first-parent` which should show only
> the commits in frameworks. If you now try that out, you will see that the
> people who made the unneeded merges actually hide commits from the people
> that didn't. See for example that if you run `gitk --first-parent` commit
> 011b6115d2dd91e9104095f3a5065e80009ea1a7 from David is not shown.
>
> This is also the reason you should not cherry-pick from 4.8 into frameworks
> by the way. If you cherry-pick, then 4.8 commits show up in `gitk --first-
> parent` when trying to look at only the frameworks branch. That means they
> are just noise, so please keep that in mind too.
>
> To help out:
>
> * Do not use git pull when working on frameworks. Use git pull --rebase
> instead.
>
> * Alternatively (preffered) configure git to always add an implicit --rebase
> to the pull command:
> http://d.strelau.net/post/47338904/git-pull-rebase-by-default
>
> * Use gitk --all to see what would happen if you push. You should never have
> to create merge commits. If you do, then please clean it up before pushing.

Yes, I realised after the fact that I had created one of these so
sorry about that. I've already now switched to using --rebase. If one
does accidentally create one of these merge commits, how can they fix
it before they push?

-- 
Matt Williams
http://milliams.com
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-21 Thread Laszlo Papp
Hi,

> There's some ideas for such hooks on the Internet already:

Yes, there are things flowing around, whereas it would be nice to have
a "Getting started" frameworks contribution page, where the advices
(requirements) could be mentioned, like this. Is there already
something like that ?

Best Regards,
Laszlo Papp
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-21 Thread Laszlo Papp
> Is there already something like that ?

There is already something here:
http://community.kde.org/Frameworks/Git_Workflow#Local_branches_are_always_rebased.2C_remote_branches_never

Might be a good idea to extend it with "git config
branch.autosetuprebase always" and the gitk advice.

-- Laszlo
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-20 Thread Alexander Neundorf
On Sunday 19 February 2012, Stephen Kelly wrote:
> Laszlo Papp wrote:
> >> Is there already something like that ?
> > 
> > There is already something here:
> http://community.kde.org/Frameworks/Git_Workflow#Local_branches_are_always_
> rebased.2C_remote_branches_never
> 
> > Might be a good idea to extend it with "git config
> > branch.autosetuprebase always" and the gitk advice.
> 
> Do you think you could add what you learned?

Yes, this would be great :-)

Alex
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-19 Thread Dario Freddi
2012/2/19 Ben Cooksley :
>
> First, our hooks are in python - so any changes would need to be in Python
> as well.

I can speak a bit of python, would be a nice way for learning more :)

>
> Second, there is a legitimate use for pushing merge commits - namely
> integrating a seperate remote branch. I have no idea if it would be possible
> to determine if this is a local only branch merge or not.

Indeed merge commits are useful in that case - although there's a
different pattern in the ones Stephen was complaining about, since you
always merge master onto (remote) master in such commits which never
makes sense. And besides that, as many on this list already know, I
advocated multiple times for crystal clear git policies across at
least all KDE core repositories - this is just one of the issues to
tackle.

>
> Third, please ensure that you disable the previously mentioned auto-rebase
> on git pull if you are merging a reemote branch, otherwise you will
> duplicate many commits, in addition to triggering the hooks for all those
> commits (which will not happen if you just merge). The hooks could even
> decide to reject your push, as it will contain too many new commits.

Also interactive rebasing can help here, but at this point a
fetch+rebase -i is actually a better option.

>
>>
>> Thanks,
>>
>> Steve.
>>
>>
>
> Regards,
> Ben Cooksley
> KDE Sysadmin.
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Please avoid noisy merge commits in frameworks

2012-02-19 Thread Dario Freddi
2012/2/19 Stephen Kelly :
> Stephen Kelly wrote:
>
>>
>> Hi there,
>>
>> I was reviewing the changes in the frameworks branch from yesterday.
>> Something I noticed was that there are a lot of merge commits that don't
>> need to exist.
>
> Ugh. Yet more of this just appeared... Recent history in the frameworks
> branch looks far more complex than it is and is harder to follow.
>
> There are too many people unaware that they're doing it maybe...

What about having a small volunteer day in which we draft some
policies for git commits and eventually implement some hooks to avoid
these (and other) things happening?

>
___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel