Difference between revisions of "Splash"

From eLinux.org
Jump to: navigation, search
(add first instance of splash page)
 
(add more splash info)
Line 8: Line 8:
 
'help' should at least give you usage.
 
'help' should at least give you usage.
  
 +
[ FIXTHIS - put usage here. ]
 +
 +
=== Splash commands ===
 +
 +
[ FIXTHIS - put list of commands here ]
  
 
== Splash setup ==
 
== Splash setup ==
Line 35: Line 40:
 
  $ splash.py continue
 
  $ splash.py continue
  
In general, Sony keeps topic branches in git under .git/refs/topics/<dev_name>/foo
+
In general, Sony keeps topic branches in git under .git/refs/topics/<developer_name>/foo
 
According to many tools these aren't valid refs because they aren't under refs/heads/
 
According to many tools these aren't valid refs because they aren't under refs/heads/
 
or refs/tags/.
 
or refs/tags/.
 
=== WIP documentation ===
 
  
 
==== Retrieving a topic branch and making a local branch ====
 
==== Retrieving a topic branch and making a local branch ====
Line 87: Line 90:
  
  
Let me know if you have any further questions.
+
=== WIP documentation ===
 
 
  
 
== Questions ==
 
== Questions ==

Revision as of 15:39, 22 January 2014

Splash is a tool to manage patch series and dependencies between them in git. A 'splash' is a patch series. The 'Splashfile' defines all of our 'splashes' and how they fit together.

Usage help

Simply executing splash.py without parameters or with the parameter 'help' should at least give you usage.

[ FIXTHIS - put usage here. ]

Splash commands

[ FIXTHIS - put list of commands here ]

Splash setup

Splash includes the splash.py program and a configuration file called 'Splashfile'.

The configuration file contains descriptions of the 'splashes' in a particular repository. To use splash, symlink the Splashfile to the working kernel directory. Put the splash.py program on your path (usually somewhere like ~/bin.

In order to use splash, you have to first fetch the splashes.

$ splash.py fetch <splash_name>

Recovering from errors

Splash has its own batch parser, similar to the one in a git interactive rebase. Previous to splash, the developers used to use 'git interactive rebase', but it is slow, and you can't batch rebases this way.

If a command fails in any way (other than argument parsing), you can recover by executing:

$ splash.py abort

or, to try the operation again, do:

$ splash.py continue

In general, Sony keeps topic branches in git under .git/refs/topics/<developer_name>/foo According to many tools these aren't valid refs because they aren't under refs/heads/ or refs/tags/.

Retrieving a topic branch and making a local branch

You can download and have all the splashes as local refs in one of the following ways:

* $ splash.py fetch # or fetch-all or fetchall; fetches all splashes
* $ splash.py fetch rhine/int # for all splashes rhine/int depends on
* $ git fetch origin $(for ref in `sed -n '/^ref/x;s/ref\s*=\s*//p' Splashfile`; do
        echo "$ref:refs/heads/${ref:12}"; done)  # poor man's splash

If you do it with splash, they won't be branches, but instead refs in refs/splash/<splash-name>. If you want to turn these into branches, try:

$ for splash in `find .git/refs/splash/ -type f`; do

     git update-ref refs/heads/splash/${splash:17} ${splash:5}; done

but keep in mind that these branches will need to be updated every time you change anything in splash. You can also make the ref a symlink instead to fix this, but I'll leave that as an exercise for the reader.

This replaced my retrieval of a topic branch:

$ git fetch origin refs/topics/<dev_name>/<splash_name>
$ git checkout -b <local_branch_name> FETCH_HEAD

Splash workflow

As a general rule, working with splash works like so:

$ splash.py fetch rhine/int

  # edit Splashfile to add splash 'my-feature'

$ splash.py start my-feature

  # make / add commits

$ git update-ref refs/splash/my-feature HEAD $ splash.py push my-feature

At any point you can also do:

$ splash.py merge rhine/int

  # test

$ splash.py unmerge rhine/int

If you change dependencies in the Splashfile, such as adding 'my-feature' to the rhine/int deps, you'll need to execute:

$ splash rebuild rhine/int


WIP documentation

Questions

  • Q: what is the 'splash.remote' needed by splash?
  • Q:

Bugs

Splash can not show help (-h) in some situations

Doing 'splash.py -h' in a repostiroy without a splash.remote results in:

No upstream specified
Please run `git config --local --add splash.remote <remote>`

If you run this outside of a git directory, you get the following:

$ splash
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/home/CORPUSERS/10102229/bin/splash", line 436, in <module>
    gitconfig = GitConfig()
  File "/home/CORPUSERS/10102229/bin/splash", line 71, in __init__
    raise subprocess.CalledProcessError(repo.returncode, cmd, output=out)
subprocess.CalledProcessError: Command '['git', 'rev-parse', '--git-dir']' returned non-zero exit status 128