PNFS Git tree recipies

From Linux NFS

Revision as of 21:13, 20 December 2007 by Andros (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

pNFS Git Tree Recipies

please use git version 1.5.0.2

git clone git://linux-nfs.org/linux-pnfs.git

then edit .git/config and change to ssh.

We want to continue development on the prototype while keeping the sessions/pnfs split. Here's some basic git recipes for doing that.

Say your git tree looks 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 -n 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@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 -n origin/master

NOTE: SAVE YOUR PATCHES!

mail to the list

      git send-email -- to:pnfs@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.

Personal tools