[pnfs] GIT Recipes

J. Bruce Fields bfields at fieldses.org
Thu Mar 15 12:23:19 EDT 2007


On Thu, Mar 15, 2007 at 09:36:24AM -0400, William A. (Andy) Adamson wrote:
> We want to continue development on the prototype while keeping the
> sessions/pnfs split.  Here's some basic git recipes for doing that.

(And note these do all assume you're using at least 1.5.0--you can check
that with git --version.)

--b.

> 
> To start with, your git tree should look like this:
>       git branch -r
>         origin/4.1-sessions
>         origin/HEAD
>         origin/master
> 
> The idea is to create your own parallel branches for 4.1-sessions and master
> to do your work in, and each day to update the origin/4.1-sessions and
> origin/master.
> 
> Contents:
>       1) working on your own copy of origin/master (pnfs + sessions).
>       2) working on your own copy of origin/4.1-sessions, and merging
>          results into master for testing.
>       3) updating your tree with patches committed by CITI.
> 
> ##########################
> 
> 1) working on your own copy of origin/master (pnfs + sessions)
> 
> Run "git fetch origin" first to make sure origin/master is up to date,
> then:
> 
>       git checkout -b my-master origin/master
> 
> to be sure...
>       git branch
>         * my-master
> 
> then make changes to existing files
> if add a file
>       git add <filename>
> if remove a file
>       git rm <filename>
> when done,
>       git commit -a
> 
> (Note: it'll give you a chance to edit the commit message.  The first
> line should be a *short* description of the patch (will be used as email
> subject line); skip a blank line then write at length with any other
> comments about the branch.)
> this commits the changes to your local tree.
> 
> to show last commit: (review the patch)
>       git show
> 
> compile, test.
> 
> create a patch for review:
> 
>       git format-patch origin/4.1-sessions
> 
> (This tells it to produce patches for all commits on your current branch
> ("my-sessions") that aren't in origin/4.1-sessions--so that's all the
> commits you've made.  Maybe just one in the example above.)
> 
> NOTE: SAVE THOSE PATCHES!
> 
> mail to the list
> 
>       git send-email --to pnfs at linux-nfs.org --from <yourself> <filelist
> from format patch>
> 
> note: the <filelist from format-patch> is usually 00*.
> 
> compile, test.
> 
> create a patch for review. (everything from the previous commit to this
> latest commit in my-master diff against origin/master)
>       git format-patch origin/master
> 
> NOTE: SAVE YOUR PATCHES!
> 
> mail to the list
> 
>       git send-email --to:pnfs at linux-nfs.org --from:<yourself> <filelist
> from format patch>
> 
> note: the <filelist from format-patch is usually 00*.
> 
> ########################################################
> 
> 2) work on your own copy of origin/4.1-sessions
> 
> Run "git fetch origin" to make sure origin/4.1-sessions is uptodate,
> then:
> 
>       git checkout -b my-sessions origin/4.1-sessions
> 
> to be sure...
>       git branch
>         * my-sessions
> 
> then make changes to existing files, git add, commit -a, and make a
> commit message as in step 1.
> 
> compile, test with NFSv4.1 (no pnfs)
> 
> Create patches for review, save them, and mail to the list as above.
> 
> Next, to merge your changes with your local origin/master (e.g the pnfs
> branch)
> 
>       git checkout -b my-master origin/master
>       git merge 4.1-sessions
> 
> If you have conflicts due to the merge, it will tell you the file names.
> The conflicts will show up in files as arrows...
> 
> <<<<<<
> 
> ======
> 
> >>>>>>
>       fix conflicts
>       git commit -a
> 
> (Note: git will automatically produce a commit message for you in this
> case.  You can add comments if you want, but usually the message it
> creates is fine on its own.)
> 
> Please, if there were non-trivial conflicts, note merge changes and send
> them to the list to help us do the repeat the merge on the citi repo:
> 
>       git show > <file>
>       email <file> to list...
> 
> (git format-patch doesn't deal with merge commits.)
> 
> the command
> 
>       gitk v2.6.18.3.. &
> 
> will bring up a nice little browser and show the merge, ignoring all the
> v2.6.18.3 kernel stuff.
> 
> ##########################
> 
> ##########################
> 
> 3) to update your tree with patches committed by CITI:
> 
> a) reset your origin branches (not your personal branches)
>       git fetch origin
> 
> b) check differences between your branches and origin due to fetch
>       git diff my-sessions origin/4.1-sessions
>       git diff my-master origin/master
> 
> c) see what is in origin that is not in your branch
>       git log my-sessions..origin/4.1-sessions
>       git log my-master..origin/master
>       (or gitk instead of git log)
> 
> you have several choices, but we suggest that you save your changes as
> patches.
> destroy your branches, and re-create them, applying the saved patches.
> (or, create new branches and destroy them after updating new branches)
> 
> to revert your branch to origin, e.g. destroy your changes
>       git checkout my-sessions
>       git reset --hard origin/4.1-sessions
> 
>       git checkout my-master
>       git reset --hard origin/master
> 
> to apply patches:
>       git am <list of files from format-patch>
> 
> to destroy a branch (if you created new personal branches, updated them, and
> want to destroy the old personal branch)
>       git branch -d
> 
> -->Andy and Bruce

> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs


More information about the pNFS mailing list