[petsc-dev] 'master' RESET after bad merge! - 'tisaac/thplex' was based on 'next'
Patrick Sanan
patrick.sanan at gmail.com
Wed Sep 3 07:21:56 CDT 2014
On 9/3/14 1:05 PM, Matthew Knepley wrote:
> On Tue, Sep 2, 2014 at 10:36 PM, Jed Brown <jed at jedbrown.org
> <mailto:jed at jedbrown.org>> wrote:
>
> Barry Smith <bsmith at mcs.anl.gov <mailto:bsmith at mcs.anl.gov>> writes:
>
> > On Sep 2, 2014, at 8:46 AM, Jed Brown <jed at jedbrown.org
> <mailto:jed at jedbrown.org>> wrote:
> >
> >> Matt, when you merged 'tisaac/thplex', you got thousands of merge
> >> commits to 'next' that should never be in 'master'. I have reset
> >> 'master' to get it out of there (everything else that was in
> 'master' is
> >> there now). This means that any recent topic branches will
> need to be
> >> rebased and any updated 'master' will need to be reset to
> >> 'origin/master'. Fix 'master' first:
> >>
> >> git fetch
> >> git checkout master
> >> git reset --hard origin/master
> >
> > Jed, please is there a way to automate this. Relying on people
> > getting to the second paragraph of an email and actually
> following
> > the directions properly seems a pretty weak “software process”.
>
> This is never supposed to be necessary. I think this is the first
> time
> and if Matt looks at his merges, we shouldn't ever need to do it
> again. ;-)
>
>
> But this was my whole point in our process discussion. Tools should
> subtract
> from what we have to worry about, not add to the cognitive load. We should
> all be manually checking for less, not more. A good tool would prevent any
> merges to master from a branch that was created from next. This seems like
> the simplest requirement to me.
Should this be possible with git hooks? I've never had occasion to use
them but naively, I'd want to do something like create a commit in
'next' which is tagged 'NeverMergeToMaster' and then set up a hook which
will automatically reject any merge to master including a commit with
that tag. The practicalities aren't clear to me, though, since as far as
I can tell BitBucket doesn't give you direct access to hooks, which you
would probably need to employ a strategy like this one:
http://stackoverflow.com/questions/13381105/git-hook-to-prevent-an-experimental-branch-pushed-to-a-release-or-master-branch
>
> Matt
>
> >> To rebase a topic branch that was started in the last few days
> (after
> >> 'tisaac/thplex' was merged; if you started before that merge,
> you don't
> >> need to do anything),
> >
> > How do I know if I started it before or after the tragic event?
>
> git log --grep tisaac/thplex
>
> If your history contains the merge, you should rebase.
>
> >> check it out, look through recent history to find
> >
> > How do I check through the recent history?
>
> git log
>
> >> the commit on 'master' that you started from (NOT part of your
> work).
> >> Suppose that commit is abcd1234.
> >
> > How do I know what that commit is?
>
> When you look at "git log", it will be the first commit that is
> not one
> you wrote for your topic branch.
>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> their experiments lead.
> -- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140903/c665b521/attachment.html>
More information about the petsc-dev
mailing list