Difference between revisions of "Git asynchronous development"

From relax wiki
Jump to navigation Jump to search
Line 47: Line 47:
 
from lib.errors import RelaxError
 
from lib.errors import RelaxError
 
</source>
 
</source>
 
+
We add the change to be recorded
 
  git add lib/software/nmrpipe.py
 
  git add lib/software/nmrpipe.py
 +
Then we make a patch
 +
git diff > nmrpipe1
 +
Then we commit
 
  git commit
 
  git commit
commit message
+
commit message. See [[Format_commit_logs]].
 
<source lang="text">
 
<source lang="text">
 
Imported expected modules in nmrpipe.py
 
Imported expected modules in nmrpipe.py
Line 56: Line 59:
 
Progress sr #3043: (https://gna.org/support/index.php?3043) Support for NMRPipe seriesTab format *.ser
 
Progress sr #3043: (https://gna.org/support/index.php?3043) Support for NMRPipe seriesTab format *.ser
  
Imported expected modules for use in lib\software\nmrpipe.py is imported>
+
Imported expected modules for use in lib\software\nmrpipe.py
 +
 
 
</source>
 
</source>
 
 
  # To see the commit message
 
  # To see the commit message
 
  git log  
 
  git log  
Line 64: Line 67:
 
  git commit --amend  
 
  git commit --amend  
  
Then we make a patch
+
 
git diff > nmrpipe1
 
 
  # Or see last changes by
 
  # Or see last changes by
 
  git log -p
 
  git log -p

Revision as of 13:00, 24 June 2013

Motivation

Subversion needs an online repository, to store each commits. Subsequent calls to svn diff > patch will generate the difference according to the last revision. Therefore the development at the moment, require to

  1. make some lines of code
  2. make a path file and a commit message
  3. use the support tracker to upload patch and commit message
  4. wait for acceptance
  5. wait for commit to official repository
  6. then do an svn update
  7. then return to point 1

This takes time, and require that repository maintainer is online.
If the above scheme is not followed, the patch files will come out of sync.

This can be solved by using git.

Initialization of git

Navigate to the root folder of the branch of relax, you want to develop. Initialize with:

git init

Setup commit information

If you havent set the repository variables for author information and commit message, this is good time. See Git_installation.

Example

Preparation

As an example, we can take the development of the NMRPipe SeriesTab reader: sr #3043: Support for NMRPipe seriesTab format *.ser

git add lib/software/nmrpipe.py
git commit

commit message

Added nmrpipe into git
# To see the commit message
git log 
# Or see last changes by
git log -p

Modification 1

Then we modify, and add following

# Python module imports.
from re import split

# relax module imports.
from lib.errors import RelaxError

We add the change to be recorded

git add lib/software/nmrpipe.py

Then we make a patch

git diff > nmrpipe1

Then we commit

git commit

commit message. See Format_commit_logs.

Imported expected modules in nmrpipe.py

Progress sr #3043: (https://gna.org/support/index.php?3043) Support for NMRPipe seriesTab format *.ser

Imported expected modules for use in lib\software\nmrpipe.py
# To see the commit message
git log 
# If you would like to replace the last commit info
git commit --amend 


# Or see last changes by
git log -p

See also