I've been working on a "git trac" subcommand to complement the git suite 
with trac integration instead of the separate UI that the sage -dev scripts 
present. This project is the basis for my release management scripts, so I 
have been eating my own dog food for a while now. I think it is now in a 
state where it would be useful to others, so I propose to integrate it as a 
standard spkg. Obligatory vote:

[ ]  Yes, please
[ ]  Make it optional
[ ]  No, you stink

http://trac.sagemath.org/ticket/15587


Usage
-----

* Print the trac ticket information using ``git trac get
  <ticket_number>``. 

      $ git trac get 12345
      
==============================================================================
      Trac #12345: Title of ticket 12345
      ...
      
==============================================================================

  Alternatively, you can pass a remote branch name, in which case trac
  is searched for a ticket whose (remote) "Branch:" field equals the
  branch name.  If that fails, the ticket number will be deduced from
  the branch name by scanning for a number. If you neither specify a
  ticket number or branch name, the local git branch name is used:

      $ git branch
      /u/user/description
      $ git trac get
      
==============================================================================
      Trac #nnnnn: Title
      <BLANKLINE>
      Description
      Status: Status                          Component: Component         
       
      ...
      Branch: u/user/description
      
==============================================================================


* Checkout 
  a remote branch:

      $ git trac checkout 12345

  Will automatically pick a local branch name ``t/12345/description``
  based on the remote branch name. If you want a particular local
  branch name, you can specify it manually:

      $ git trac checkout -b my_brach 12345


* Create a new ticket on trac, and a new local branch 
  corresponding to it:

      $ git trac create "This is the summary"

  This will automatically create a local branch name
  ``t/12345/this_is_the_summary``. You can specify it manually if you
  prefer with:
  
      $ git trac create -b my_branch "This is the summary"


* Pull (= fetch + merge) from the branch
  on a ticket:

      $ git trac pull 12345

  You can omit the ticket number, in which case the script will try to
  search for the ticket having the local branch name attached. If that
  fails, an attempt is made to deduce the ticket number from the local
  branch name.


* Push (upload) to the branch
  on a ticket, and set the trac "Branch:" field accordingly:

      $ git trac push 12345

  You can omit the ticket number, in which case the script will try to
  search for the ticket having the local branch name attached. If that
  fails, an attempt is made to deduce the ticket number from the local
  branch name.


* Log of the commits for a
  ticket:

      $ git trac log 12345
    

* Find the trac ticket for a 
  commit, either identified by its SHA1 or branch/tag name.

      $ git log --oneline -1 ee5e39e
      ee5e39e Allow default arguments in closures
      $ git trac find ee5e39e
      Commit has been merged by the release manager into your current 
branch.
      commit 44efa774c5f991ea5f160646515cfe8d3f738479
      Merge: 5fd5442 679310b
      Author: Release Manager <rele...@sagemath.org>
      Date:   Sat Dec 21 01:16:56 2013 +0000

          Trac #15447: implement evaluation of PARI closures


Too Long, Didn't Read
---------------------

To fix a bug, start with

    $ git trac create "Fix foo"
    
This will open the ticket and create a new local branch
``t/<number>/fix_foo``. Then edit Sage, followed by 

    $ git add <filename>
    $ git commit

Repeat edit/commit as necessary. When you are finished, run

    $ git trac push

It will take the ticket number out of the branch name, so you don't
have to specify it.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to