Jed,

I don't think your reply below really does what I want to do.  My wdn_mods_next 
branch is
a branch that I maintain that was derived from the next branch.  I do not merge 
changes
from wdn_mods_next into the next branch.  The next branch is supposed to be a 
mirror of
the official petsc next branch and I only update the next branch in my petsc 
clones by first
performing a "git remote -v update origin" in my bare mirror repo which mirrors 
the petsc maint,
master and next branches as well as containing any additional branches that I 
create.

So, I update wdn_mods_next from the latest copy of next that I have by using 
the following
command:

git pull origin next

in the petsc directory where I have wdn_mods_next checked out.  Generally this 
is easy and
has no conflicts to resolve but on a rare occasion, I might have to resolve a 
conflict.  This is
because my wdn_mods_next branch does not differ much from next - just a few 
hacks I have
had to resort to.

So here is one way I think I could accomplish my goal.  In my bare, mirror repo 
execute

git remote -v update origin

At this point my bare mirror repo now has a copy of the new unwound next branch 
- if I am
understanding correctly.

Then in a clone of my mirror repo execute

git checkout wdn_mods_next
git reset --hard next
git push origin +wdn_mods_next

If I understand correctly, then my wdn_mods_next branch would be identical to 
the next
branch and I would not have the changes I made to next that resulted in 
wdn_mods_next.

Then I could untar a file of those changes on top of my clone with 
wdn_mods_next checked
out and recommit those changes.  This is about half a dozen files.  But this 
seems like a
hacky way to do business that is only reasonable because I have a small number 
of files.

Isn't there a better way to do this?

Perhaps you or Satish might ask why I am using next instead of master.  The 
reason is that
I am forever uncovering some bug in petsc that you guys fix on the next branch 
and I don't
want to wait for several days before it gets pulled into master and I can 
resume productive
work.

So maybe there is some flaw or weakness in my git work flow.  I have been using 
git for
several years now but am not a power user.  I like git but do not really want 
to have to
become a git guru.  However, this petsc policy of periodically unwinding the 
next branch
seems to always disrupt my workflow - so I have not found a robust way to deal 
with it
yet.

Dave

________________________________________
From: Jed Brown [[email protected]]
Sent: Thursday, October 02, 2014 4:39 PM
To: Satish Balay; Nystrom, William David
Cc: petsc-users; [email protected]
Subject: Re: [petsc-dev] [petsc-users] petsc git next branch *is* unwound!

Satish Balay <[email protected]> writes:

> You would have to delete both 'next' and 'wdn_mods_next' branches from
> all your clones - and recreate them.

Do your normal "git remote update" (or git fetch) in your "master" clone
(confusing to use the same name to refer to a repository and a branch).
I'll call the repository Mirror.  Anyway, you should see that all three
branches are updated.  'maint' and 'master' should fast-forward, while
'next' will say "forced update".

After that, recreate 'next' on the clones just like in Satish's original
email.

Reply via email to