public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Personal branches and restrictions with GIT repository
@ 2015-05-28  9:48 Phil Muldoon
  2015-05-28 10:11 ` Matthew Fortune
  2015-05-28 13:44 ` Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Phil Muldoon @ 2015-05-28  9:48 UTC (permalink / raw)
  To: gdb


If you create a personal branch in GDB's GIT repository, that personal
branch has the same restrictions applied to it that Master does. I
understand the caution around Master; we are all still in the learning
phase and the integrity of Master should be maintained with caution.

But in the case of personal branches, do these cautions and
restrictions need to apply? Here's my work-flow to keep my branch up to
date with Master, for myself, and others who follow it.

git checkout master; git pull; git checkout users/pmuldoon/c++compile; git merge master; git push

This just makes my branch = Master + my changes. It does not, of
course, affect Master in any way. However if I try to push the result
of above, I get:

remote: *** Pattern "Merge branch '.*'" has been detected.
remote: *** (in commit 2c03baba0870c1d734c6e35725f1c2a29e35eec7)
remote: ***
remote: *** This usually indicates an unintentional merge commit.
remote: *** If you would really like to push a merge commit, please
remote: *** edit the merge commit's revision history.

As I mentioned above, this is perfectly ordinary and okay with
Master. If that is the policy, well, that's the policy. But do such
restrictions need to apply to personal branches as well?

The hook message hints at a workaround. Rename the commit so it does
not look like a merge. But that seems to be walking into a gray area
to me. Another workaround is to delete the personal branch, recreate
it from Master, and apply your local changes again. While this is not
too bad, it seems "make-work" and not in keeping with GIT's
philosophy.

So this boils down to two questions:

1) Do we need this hook for personal branches?

2) And are users allowed to do whatever they want in their own
   personal branch (within sane defaults)?

Cheers,

Phil

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

* RE: Personal branches and restrictions with GIT repository
  2015-05-28  9:48 Personal branches and restrictions with GIT repository Phil Muldoon
@ 2015-05-28 10:11 ` Matthew Fortune
  2015-05-28 10:16   ` Phil Muldoon
  2015-05-28 13:44 ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Fortune @ 2015-05-28 10:11 UTC (permalink / raw)
  To: Phil Muldoon, gdb

> git checkout master; git pull; git checkout users/pmuldoon/c++compile;
> git merge master; git push
> 
> This just makes my branch = Master + my changes. It does not, of course,
> affect Master in any way.

If the long term aim is to submit the code to master you may find it
easier to rebase and force push to your personal branch. I'm assuming
force push to a personal branch is allowed.

This keeps all your commits at the top too. This method works well until
you have multiple contributors but with some practice it is possible to
work as a group with rebase+force push.

Matthew


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

* Re: Personal branches and restrictions with GIT repository
  2015-05-28 10:11 ` Matthew Fortune
@ 2015-05-28 10:16   ` Phil Muldoon
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Muldoon @ 2015-05-28 10:16 UTC (permalink / raw)
  To: Matthew Fortune, gdb

On 28/05/15 11:11, Matthew Fortune wrote:
>> git checkout master; git pull; git checkout users/pmuldoon/c++compile;
>> git merge master; git push
>>
>> This just makes my branch = Master + my changes. It does not, of course,
>> affect Master in any way.
>
> If the long term aim is to submit the code to master you may find it
> easier to rebase and force push to your personal branch. I'm assuming
> force push to a personal branch is allowed.
>
> This keeps all your commits at the top too. This method works well until
> you have multiple contributors but with some practice it is possible to
> work as a group with rebase+force push.
>
> Matthew

I don't want to get into GIT work-flows ;) There are seemingly dozens
of ways to do the same thing in GIT. But as the branch has to go
through review first, and that entails a patch series, I normally just
rebase at the end to another temporary branch and squash commits to
create that patch-series. That's worked quite well for me.

You can't rebase or force commit to a personal branch either, as I
understand.

Cheers

Phil

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

* Re: Personal branches and restrictions with GIT repository
  2015-05-28  9:48 Personal branches and restrictions with GIT repository Phil Muldoon
  2015-05-28 10:11 ` Matthew Fortune
@ 2015-05-28 13:44 ` Joel Brobecker
  2015-05-28 14:03   ` Phil Muldoon
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2015-05-28 13:44 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: gdb

> So this boils down to two questions:
> 
> 1) Do we need this hook for personal branches?

It's a hook aimed at users who are not very familiar with git
and who might accidently do a merge instead of a rebase.
Un understand that this can be felt as a PITA for more experienced
git users, but it is a really easy mistake to make when one is not
paying attention, and it is also quickly resolved.

> 
> 2) And are users allowed to do whatever they want in their own
>    personal branch (within sane defaults)?

To answer your two questions, I think it boils down to policy
rather than need. The hooks should accomodate the policy.

We can turn all pre-commit checks for user-branches. I don't believe
that the hooks, as currently implemented, support turning off just
that "accidental merge" check. The latter can, of course, be easily
implemented.

FWIW, my take is that if you're going to have your branch hosted
on the sourceware git, it's not a big effort to be following the same
guidelines as other official branches. But if people want it otherwise,
then we can adjust the hooks.

-- 
Joel

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

* Re: Personal branches and restrictions with GIT repository
  2015-05-28 13:44 ` Joel Brobecker
@ 2015-05-28 14:03   ` Phil Muldoon
  2015-06-30 20:19     ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Muldoon @ 2015-05-28 14:03 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

On 28/05/15 14:44, Joel Brobecker wrote:
>
> 2) And are users allowed to do whatever they want in their own
>    personal branch (within sane defaults)?
>
> To answer your two questions, I think it boils down to policy
> rather than need. The hooks should accomodate the policy.
>
> We can turn all pre-commit checks for user-branches. I don't believe
> that the hooks, as currently implemented, support turning off just
> that "accidental merge" check. The latter can, of course, be easily
> implemented.
>
> FWIW, my take is that if you're going to have your branch hosted
> on the sourceware git, it's not a big effort to be following the same
> guidelines as other official branches. But if people want it otherwise,
> then we can adjust the hooks.

Yeah I think this is the question really. And to reiterate not talking
about Master here, just personal branches. Are we free (in the case of
a merge commit to a personal branch), to ignore the hook and commit
anyway? Is it a suggestion or a directive? That's the crux of the
matter.

I've not checked the wiki yet. Maybe some guidelines for personal
branches and/or master branches would be ideal. I'll volunteer to get
one started if nobody else does. Just need to know the said guidelines
first ;)

Cheers


Phil


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

* Re: Personal branches and restrictions with GIT repository
  2015-05-28 14:03   ` Phil Muldoon
@ 2015-06-30 20:19     ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2015-06-30 20:19 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: gdb

> Yeah I think this is the question really. And to reiterate not talking
> about Master here, just personal branches. Are we free (in the case of
> a merge commit to a personal branch), to ignore the hook and commit
> anyway? Is it a suggestion or a directive? That's the crux of the
> matter.
> 
> I've not checked the wiki yet. Maybe some guidelines for personal
> branches and/or master branches would be ideal. I'll volunteer to get
> one started if nobody else does. Just need to know the said guidelines
> first ;)

No one else really provided any opinion so far. Although I would prefer
if personal branches were to follow the standard practices, I do not
have a particularly strong opinion on that. So let's give it another
couple of weeks, and if there are still no opinion, I will let you
chose and document the policy for personal branches.

-- 
Joel

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

end of thread, other threads:[~2015-06-30 20:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28  9:48 Personal branches and restrictions with GIT repository Phil Muldoon
2015-05-28 10:11 ` Matthew Fortune
2015-05-28 10:16   ` Phil Muldoon
2015-05-28 13:44 ` Joel Brobecker
2015-05-28 14:03   ` Phil Muldoon
2015-06-30 20:19     ` Joel Brobecker

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 read-only IMAP folder(s) and NNTP newsgroup(s).