--- stgit-0.14.2.orig/Documentation/Makefile +++ stgit-0.14.2/Documentation/Makefile @@ -1,7 +1,6 @@ MAN1_TXT=$(wildcard stg*.txt) -MAN7_TXT= -DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) +DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT)) ARTICLES = # with their own formatting rules. @@ -11,12 +10,10 @@ DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES)) DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) -DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) prefix?=$(HOME) -mandir?=$(prefix)/man +mandir?=$(prefix)/share/man man1dir=$(mandir)/man1 -man7dir=$(mandir)/man7 # DESTDIR= ASCIIDOC=asciidoc --unsafe @@ -37,16 +34,14 @@ html: $(DOC_HTML) pdf: $(DOC_PDF) -$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf +$(DOC_HTML) $(DOC_MAN1): asciidoc.conf -man: man1 man7 +man: man1 man1: $(DOC_MAN1) -man7: $(DOC_MAN7) install: man - $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) + $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir) - $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir) # # Determine "include::" file references in asciidoc files. # --- stgit-0.14.2.orig/contrib/stg-gitk +++ stgit-0.14.2/contrib/stg-gitk @@ -48,10 +48,10 @@ refdirs="$GIT_DIR/refs" else # default to current branch - if [ "$branches" == "" ]; then + if [ "$branches" = "" ]; then branches="$(stg branch)" fi - if [ "$branches" == "" ]; then + if [ "$branches" = "" ]; then echo >&2 "ERROR: cannot find current branch." exit 1 fi --- stgit-0.14.2.orig/stgit/utils.py +++ stgit-0.14.2/stgit/utils.py @@ -180,7 +180,7 @@ elif 'EDITOR' in os.environ: editor = os.environ['EDITOR'] else: - editor = 'vi' + editor = 'editor' editor += ' %s' % filename out.start('Invoking the editor: "%s"' % editor) --- stgit-0.14.2.orig/setup.py +++ stgit-0.14.2/setup.py @@ -46,7 +46,7 @@ # Check the minimum versions required if sys.argv[1] in ['install', 'build']: __check_python_version() - __check_git_version() + #__check_git_version() # ensure readable template files old_mask = os.umask(0022) --- stgit-0.14.2.orig/debian/changelog +++ stgit-0.14.2/debian/changelog @@ -0,0 +1,149 @@ +stgit (0.14.2-1) unstable; urgency=low + + * New upstream release. + * Make the copyright notice more explicit to please lintian. + + -- Yann Dirson Fri, 04 Apr 2008 21:17:40 +0200 + +stgit (0.14.1-4) unstable; urgency=low + + * Changed default editor from "vi" to "editor" (Closes: #463819). + * Fixed bashisms in contrib/stg-gitk (Closes: #465360). + * Upgrade dependency on git-core to 1.5.3 or better for "git rev-parse + --is-inside-work-tree", and use an epoch (Closes: #461385). + * Declare depency on python 2.4 or higher through debian/pyversions + (Closes: #457826). + * Remove reference to cogito in old tutorial (Closes: #470131). + * Set myself as maintainer (Closes: #435200). + * Fixed typos in description (lintian). + * Move the Homepage link from extended description into a control field + (lintian). + * Bumped Standards-Version to 3.7.3, no change. + + -- Yann Dirson Mon, 24 Mar 2008 09:23:17 +0100 + +stgit (0.14.1-3) unstable; urgency=low + + * Corrected debian/copyright to read "version 2" and not "version 2 or + later" as GPL choice, as noted by ftpmaster team. + + -- Yann Dirson Thu, 20 Dec 2007 23:42:24 +0100 + +stgit (0.14.1-2) unstable; urgency=low + + * Rebuild so -contrib does include the scripts - the previous + dpkg-source run used "-i.git" which turns out not to have the intended + behaviour. + + -- Yann Dirson Tue, 18 Dec 2007 23:00:42 +0100 + +stgit (0.14.1-1) unstable; urgency=low + + * New upstream release. + * Updated package short description. + * New stgit-contrib package. + * Fix debian/rules to build things in binary-indep, not binary-arch. + * Add a call to "make clean" in clean target, somes generated files were + not removed. + * Update git versionned dependency to 1.5.2 or better. + * Disabled checking for git version at build time, so we don't need to + add a build-dep on git. + * Add a build-depend on xmlto for manpage generation. + + -- Yann Dirson Sun, 16 Dec 2007 17:34:12 +0100 + +stgit (0.13-1) unstable; urgency=low + + * New upstream release. + * Add debian/watch file. + * Build documentation, build-depend on asciidoc. + * Fixed Documentation/Makefile to ignore non-existent man7 material, and + to use /usr/share/man. + * Install all html doc in a new "html" subdir. + + -- Yann Dirson Sun, 29 Jul 2007 15:00:52 +0200 + +stgit (0.12.1-4) unstable; urgency=medium + + * Applied upstream fix for a bug possibly causing data loss during merge + in a corner case. + + -- Yann Dirson Tue, 1 May 2007 11:56:47 +0200 + +stgit (0.12.1-3) unstable; urgency=low + + * Upload to unstable (Closes: #418302). + + -- Yann Dirson Mon, 16 Apr 2007 22:17:12 +0200 + +stgit (0.12.1-2) experimental; urgency=low + + * Let upstream build procedure install in /usr/share/stgit: templates + and contrib are now available there. + * Install bash completions in /etc, overriding those from + git-completion. + * Removed useless dh_python call (lintian). + + -- Yann Dirson Mon, 26 Feb 2007 21:17:56 +0100 + +stgit (0.12.1-1) experimental; urgency=low + + * New upstream release, has better online help (Closes: #407238). + * Upload to experimental since this is not targetted to etch. + * Recommend git-core 1.5 or later, since stgit will work much better + then. + * Changed the fallback editor from "vi" to "editor" as per policy. + * Updated tutorial from the wiki. + * Also include StGITtheory doc from the wiki. + + -- Yann Dirson Sun, 25 Feb 2007 12:01:58 +0100 + +stgit (0.11-1) unstable; urgency=low + + * New upstream release (Closes: #396982). + + -- Yann Dirson Sun, 26 Nov 2006 22:33:54 +0100 + +stgit (0.10-1) unstable; urgency=low + + * New upstream release (Closes: #374043) + * Add Yann Dirson to Uploaders too + * Update to Policy 3.7.2 + * Update to new Python policy (Closes: #380963) + + -- Anand Kumria Sun, 2 Jul 2006 09:28:27 +1000 + +stgit (0.9-1) unstable; urgency=low + + * New upstream release (Closes: #362035) + * Include examples (Closes: #362196) + * Include documentation (Closes: #362195) + + -- Anand Kumria Mon, 1 May 2006 06:21:58 +1000 + +stgit (0.8.1-3) unstable; urgency=low + + * Fixup spelling in Description (Closes: #353054) + * Remove the build directory on clean + + -- Anand Kumria Thu, 2 Mar 2006 11:44:59 +1100 + +stgit (0.8.1-2) unstable; urgency=low + + * Depend on git-core (Closes: #352335) + * Build-Depend on python-dev (Closes: #352306) + + -- Anand Kumria Sun, 12 Feb 2006 15:23:27 +1100 + +stgit (0.8.1-1) unstable; urgency=low + + * New upstream release + + -- Anand Kumria Tue, 24 Jan 2006 12:04:11 +1100 + +stgit (0.8-1) unstable; urgency=low + + * New upstream release + + -- Anand Kumria Sun, 25 Dec 2005 13:05:24 +1100 + --- stgit-0.14.2.orig/debian/compat +++ stgit-0.14.2/debian/compat @@ -0,0 +1 @@ +4 --- stgit-0.14.2.orig/debian/dirs +++ stgit-0.14.2/debian/dirs @@ -0,0 +1 @@ +usr/bin --- stgit-0.14.2.orig/debian/rules +++ stgit-0.14.2/debian/rules @@ -0,0 +1,110 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + python setup.py build + $(MAKE) -C Documentation man html + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + python setup.py clean + $(MAKE) clean + rm -f stgit/__init__.pyc + rm -f stgit/version.pyc + rm -rf build + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + python setup.py install --root=$(CURDIR)/debian/stgit + mv debian/stgit/usr/share/stgit/examples debian/stgit/usr/share/doc/stgit + + $(MAKE) -C Documentation install prefix=/usr DESTDIR=$(CURDIR)/debian/stgit + mkdir -p debian/stgit/usr/share/doc/stgit/html + cp debian/*.html Documentation/*.html debian/stgit/usr/share/doc/stgit/html + + mkdir -p debian/stgit/etc/bash_completion.d + mv debian/stgit/usr/share/stgit/contrib/stgit-completion.bash \ + debian/stgit/etc/bash_completion.d/stg + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_pysupport + # fixup dh_pysupport bad perms + chmod -R g-w $(CURDIR)/debian/stgit/usr/share/python-support +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- stgit-0.14.2.orig/debian/control +++ stgit-0.14.2/debian/control @@ -0,0 +1,41 @@ +Source: stgit +Section: devel +Priority: optional +Maintainer: Yann Dirson +Build-Depends: debhelper (>= 5.0.37.2), python-dev, asciidoc, xmlto +Build-Depends-Indep: python-support (>= 0.3) +Uploaders: Yann Dirson , Anand Kumria +Standards-Version: 3.7.3 +Homepage: http://www.procode.org/stgit/ + +Package: stgit +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, git-core (>= 1:1.5.3) +Replaces: git-completion +Description: manage stacks of patches in a git repository + stgit provides similar functionality to quilt + (i.e. pushing/popping patches to/from a stack) on top of git. + . + These operations are performed using git commands and the patches + are stored as git commit objects, allowing easy merging of the stgit + patches into other repositories using standard git functionality. + +Package: stgit-contrib +Architecture: all +Depends: stgit +Description: set of contributed script to help working with stgit + Among others, this package provides the following helper scripts: + * stg-gitk: show all patches in gitk, not only applied ones, and hide + logs + * stg-whatchanged: examine how the to-be-committed changes modify the + current patch + * stg-fold-files-from: pick specific hunks from another patch up + the stack + * stg-dispatch: dispatch specific hunks into another patch down + the stack + * stg-swallow: completely merge another patch into the current one + * stg-k: provide robust --keep functionality to all stgit commands + . + Most of the functionality of these scripts may one day be + incorporated into stgit. --- stgit-0.14.2.orig/debian/StGIT_Tutorial.html +++ stgit-0.14.2/debian/StGIT_Tutorial.html @@ -0,0 +1,40 @@ + +StGIT Wiki: StGIT Tutorial

Introduction

StGIT is a Python application that provides functionality similar to quilt (i.e. pushing/popping patches to/from a stack) using GIT instead of 'diff' and 'patch'. StGIT stores its patches in a GIT repository as normal GIT commit objects.

StGIT is not an SCM interface on top of GIT. For standard SCM operations use GIT's porcelain commands.

StGIT is available for download at http://www.procode.org/stgit/ .

This tutorial assumes you are already familiar with GIT. For more information on GIT, see the GIT tutorial or git(7) .

Basic Operation

Help

For a full list of StGIT commands:

stg --help
+

For help on individual subcommands:

stg <cmd> (-h | --help)
+

Repository initialisation

In stand-alone mode, StGIT is used in conjunction with a GIT repository that is already initialised (using 'git-init-db'). StGIT cannot be used outside of a GIT repository.

Any branch in a GIT repository may be managed by StGIT. Each branch managed by StGIT contains an independent series of StGIT patches.

To initialise an existing GIT branch to be managed by StGIT, cd into the top of your GIT repository, check out the branch you'd like to manage with StGIT, and type:

stg init
+

Run the 'stg init' command for any pre-existing GIT branches intended to be used with StGIT.

As a convention, you should avoid working in the 'master' branch of a remote project and use it only as a reference, since it reflects someone else's work.

You can switch between GIT branches with:

stg branch [<branch name>]
+

This checks out the named branch and places you at the topmost applied StGIT patch in that branch.

Alternately, you can create branches using only StGIT commands, which will automatically prepare them for use with StGIT:

stg branch --create <new branch>
+

Working with remote repositories

With a single command, StGIT can create and initialize a GIT repository which mirrors a remote GIT repository. This is known as cloning. All GIT transports are supported.

To clone a repository, use:

stg clone <repository> <local-dir>
+

This creates a fresh local repository, initialises a GIT database in it, pulls the latest version of the remote, and creates and initialises a 'master' branch for use with StGIT.

At any time you can pull the latest changes from the remote repository. By default, StGIT pulls from the location stored in .git/branches/origin, and updates the base of the current branch.

To pull the latest changes from a remote repository, use:

stg pull [<branch> or 'origin']
+

This command removes all applied StGIT patches from the current branch, updates the branch's base commit, then attempts to re-apply the patches. Any merge conflicts will halt this process, allowing you to clean up the conflicts and continue (see below).

If the maintainer of the remote repository includes one of your patches in the published repository that you pull from, StGIT can usually recognize that an incoming patch from the remote matches one of yours, and it turns your local version into an empty patch.

To automatically delete empty patches after a pull, use:

stg clean
+

As a convention, you should avoid working in the 'master' branch and use it only as a reference, since it reflects someone else's work. If you decide to publish your GIT repository, you'll want your own work separated into its own branch to make it convenient for others to pull just your patches.

Getting started: creating a patch

Changes to your working directory are saved in a patch. An StGIT patch is simply a saved set of modifications to your working directory, plus a saved description. To create an empty StGIT patch in the current branch:

stg new <name>
+

To save the changes you've made (that is, to refresh a patch), use:

stg refresh
+

To discard changes in your working directory, use:

git checkout -f
+

This restores your working directory to the state it was in the last time the patch was refreshed.

Modified files that haven't been saved via a refresh operation can be viewed with:

stg status
+

You can view modified files that have already been saved into a patch:

stg files
+

The 'stg refresh' command automatically notes changes to files that already exist in the working directory, but you have to tell StGIT explicitly if you add, remove, or rename files.

To record the addition or deletion of files in your new patch:

stg add [<file>*]
+stg rm [<file>*]
+

To record the renaming of a file in your new patch, issue both of these commands:

stg rm <oldfilename>
+stg add <newfilename>
+

Stack manipulation: managing multiple patches

StGIT can manage more than one patch at a time. A series of StGIT patches in a GIT branch are known collectively as a stack. The new patch you created above is now the topmost patch in your stack. You can always see the name of the topmost (current) patch with:

stg top
+

The topmost patch is used as the default patch for most StGIT operations. It is the default target of the 'stg refresh' command, for example.

Patches that are pushed onto the stack are referred to as applied, and patches that are popped off the stack are referred to as unapplied.

To push/pop a patch to/from a stack:

stg push [--all | <name>]
+stg pop [--all]
+

The last patch you pushed is the topmost patch. This patch is always in the applied list; StGIT can't operate on an unapplied patch unless you apply it first.

You can display the order of patches in a stack with one of these commands:

stg series
+stg applied
+stg unapplied
+

By default the 'stg push' command applies the first patch in the unapplied list, but you can push any patch in the unapplied list by giving the name of the patch. This is useful if you want to reorder the patches in a stack.

During a push operation, merge conflicts can occur (especially if you are changing the order of the patches in your stack). If the push causes merge conflicts, they need to be fixed and 'stg resolved' run (see below). A 'push' operation can also be reverted with 'stg push --undo'.

A few more stack basics; to rename a patch:

stg rename <old-name> <new-name>
+

To delete a patch:

stg delete <name>
+

This permanently discards the named patch. In other words, the patch no longer appears in either the applied or unapplied lists, and cannot be reapplied to the series.

You may want to make patches in your stack a permanent part of your GIT repository, for example if you are publishing your repository to others. To do this, use:

stg commit
+

This merges all applied patches in your patch series into the GIT repository and removes them from your stack. Use this command only if you want to permanently store the applied patches and no longer manage them with StGIT.

Converting between StGIT patches and text diffs

As mentioned in the introduction, StGIT stores modifications to your working tree in the form of GIT commits. This means if you want to apply your changes to a tree not managed by GIT, or send your changes to someone else in e-mail, you need to convert your StGIT patches into normal textual diffs that can be applied with the GNU 'patch' command.

The 'stg diff' command is a powerful way to generate and view textual diffs of patches managed by StGIT.

To view a diff of the topmost patch:

stg diff -r /
+

Observe that this does not show any changes in the working directory that have not been saved by a 'refresh'. To view just the changes you've made since the last refresh, use:

stg diff -r /top
+

If you want to see the changes made by the patch combined with any unsaved changes in the working directory, try:

stg diff -r /bottom
+

You can also show the changes to any patch in your stack with:

stg diff -r <patch>/
+

Use this command to view all the changes in your stack up through the current patch:

stg diff -r base
+

The 'stg diff' command supports a number of other features that are very useful. Be sure to take a look at the help information for this command.

To convert your StGIT patches into patch files:

stg export [--range=[<patch1>[:<patch2>]]] [<dir-name>]
+

The 'export' command supports options to automatically number the patches (-n) or add the '.diff' extension (-d). If you don't tell "stg export" where to put the patches, it will create directory named "patch-branchname" in your current directory, and store the patches there.

To e-mail a patch or range of patches:

stg mail [--to=...] (--all | --range=[<patch1>[:<patch2>]] | <patch>)
+

"stg mail" has a lot of options, so read the output of "stg mail -h" for more information.

You can also import an existing GNU diff patch file as a new StGIT patch with a single command. "stg import" will automatically parse through the patch file and extract a patch description. Use:

stg import [<file>]
+

This is the equivalent of "stg new" followed by "patch -i <file>", then "stg refresh -e".

Sometimes the patch file won't apply cleanly. In that case, "stg import" will leave you with an empty StGIT patch, to which you then apply the patch file by hand using "patch -i" and your favorite editor.

To merge a GNU diff file (defaulting to the standard input) into the topmost patch:

stg fold [<file>]
+

This command supports a '--threeway' option which applies the patch onto the bottom of the topmost one and performs a three-way merge.

Advanced Usage

Handling merge conflicts

Pushing a patch on the stack can fail if the patch cannot be applied cleanly. This usually happens if there are overlapping changes in the tree, the patch depends on another patch which is not applied, or if a patch was not merged upstream in the exact form it was sent.

The 'push' operation stops after the first patch with conflicts. The 'status' command shows the conflict files by marking them with a 'C'. If the 'keeporig' options is set to 'yes' (the default), the original files involved in the merge operations are left in the tree as <file>.older, <file>.local and <file>.remote for better analysis of the conflict. If 'diff3' is used as the merger (the default), markers are added to the conflicted files as well.

Run the 'resolved' command to mark the conflicts resolved and remove the temporary merge files from the working tree. Then run the 'refresh' command to update the StGIT patch with the modifications you made to resolve the conflict.

Configuration file

StGIT tries to read the configuration options from the following files: /etc/stgitrc, ~/.stgitrc and .git/stgitrc. The latter overrides the options in the former files. If no file is found, the defaults are used.

An example configuration file with options description can be found in the examples/ directory. Most users would probably only define the 'smtpserver' option used by the 'mail' command.

The gitmergeonefile.py script does the three-way merging on individual files using the tool specified by the 'merger' option. The user can specify a smarter tool to be used.

Templates

The 'export' and 'mail' commands use templates for generating the patch files or e-mails. The default templates are installed under <prefix>/share/stgit/templates/ and, combined with the extra options available for the commands, should be enough for most users. The template format uses the standard Python string formatting rules. The variables available are shown in the the help message for the commands.

The 'mail' command can also send an initial e-mail for which there is no default template. The <prefix>/share/stgit/examples/covermail.tmpl file can be used as an example.

A default description for new patches can be defined in the .git/patchdescr.tmpl file. This is useful for things like signed-off-by lines.

Merging two patches into one

There used to be no command to do this directly at the moment but one can export the patch to be merged and use the 'stg fold' command on the generated diff file. Since 0.8, "stg pick --fold <patch>" will merge <patch> into the current one. Assuming that the merged patch was not already applied, the operation will succeed. Pushing the merged patch onto the stack will result in an empty patch (StGIT notifying the user) that can be safely deleted.

The Theory behind StGIT

More information about how StGIT works can be found here.

+ + --- stgit-0.14.2.orig/debian/copyright +++ stgit-0.14.2/debian/copyright @@ -0,0 +1,25 @@ +This package was debianized by Anand Kumria on +Sun, 25 Dec 2005 13:05:24 +1100. + +It was downloaded from http://www.procode.org/stgit/ + +Copyright (c) 2006-2008 Cataling Marinas +and others. + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of version 2 of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. --- stgit-0.14.2.orig/debian/docs +++ stgit-0.14.2/debian/docs @@ -0,0 +1,2 @@ +README +TODO --- stgit-0.14.2.orig/debian/pycompat +++ stgit-0.14.2/debian/pycompat @@ -0,0 +1 @@ +2 --- stgit-0.14.2.orig/debian/StGITtheory.html +++ stgit-0.14.2/debian/StGITtheory.html @@ -0,0 +1,72 @@ + +StGIT Wiki: StGITtheory

A Bit of StGIT Patch Theory

Every patch in StGIT is internally represented as two nodes - the bottom and the top. The nodes are commit IDs stored in the GIT object database. The actual patch is the diff between the trees corresponding to the bottom and the top nodes. This can be written as

P = diff(Nb, Nt)
+
+P  - patch
+Nb - bottom (start) node
+Nt - top (end) node
+

The order of diff arguments is (old, new).

For an ordered stack of patches:

P1 = diff(N0, N1)
+P2 = diff(N1, N2)
+...
+
+Ps = P1 + P2 + P3 + ... = diff(Nsb, Nst)
+
+Ps  - the cumulative patch of the whole stack
+Nsb - bottom stack node (same as N0)
+Nst - top stack node (same as Nn)
+

The plus sign presents superposition of patches. Please note that such superposition is not always commutative.

Whenever StGIT pulls changes from another repository, it unapplies (pops) all applied patches, updates the branch using git commands and tries to re-apply (push) the patches that were applied.

Popping a patch from the stack is done by simply setting the stack top Nst to the patch bottom Nb. Pushing is not always trivial and may need merging.

When pushing an unapplied patch P from the stack, it may happen that the patch bottom Nb is different from the stack top Nst, i.e. the patch was originally applied to a different tree. In this case, the patch needs to be adjusted to its new position on the stack. First, the new stack top is calculated by diff3 merging:

Nst' = diff3(Nst, Nb, Nt)
+

The order of diff3 parameters is (branch1, ancestor, branch2).

If the merge succeeds, the patch is adjusted as following:

Nb' = Nst
+Nt' = Nst'
+P'  = diff(Nb', Nt')
+

Nb' and Nt' become the new bottom and top nodes of the patch, and the stack top is advanced to Nst'.

If the the merge fails, the user is requested to resolve conflicts and refresh the patch by "stg refresh". It is also possible to undo the failed push by "stg push --undo".

This approach allows easy reordering of patches. To reorder applied patches, the user should pop them first and then push them back to the stack in the desired order. Unless the patches modify the same or adjacent lines in the same files, StGIT should be able to adjust the patches automatically for the new order.

Layout of the .git Directory

branches/		remote branches to pull (deprecated)
+hooks/			scripts executed by git on some events
+info/
+  exclude		list of files ignored for the purpose of commit
+  refs			list of commit IDs from refs/ (used on servers)
+objects/		git objects
+  00/			unpacked objects
+  ...
+  ff/
+  info/
+    packs		list of object packs
+  pack/			object packs
+    *.idx		index files
+    *.pack		actual pack files
+patches/		storage for StGIT patches
+  master/		patches for the master branch
+    patches/		storage for individual patches
+      patch1/		name of one of the StGIT patches
+        authdate	patch date
+        authemail	author's e-mail
+        authname	author's name
+        bottom		bottom ID of the patch
+        bottom.old	old bottom ID of the patch (for undo)
+        commemail	committer's e-mail
+        commname	committer's name
+        description	patch description
+        top		top ID of the patch
+        top.old		old top ID of the patch (for undo)
+      patch2/		name of another StGIT patch
+        ...
+    applied		list of applied patches
+    current		name of the topmost patch
+    description		branch description
+    protected		if present, the branch is protected against changes
+    unapplied		list of unapplied patches
+  other-branch/		patches for "other-branch"
+    ...
+refs/			various significant commit IDs
+  bases/		bottom commit IDs of the patch stacks
+  heads/		top commit IDs of branches
+  patches/		commit IDs of StGIT patches
+  tags/			commit IDs of tags (commit and tag objects)
+remotes/		remote branches to pull and push
+FETCH_HEAD		list of fetched branches and their commit IDs
+HEAD			reference to the current branch
+ORIG_HEAD		previous commit ID of the head branch
+config			configuration of the repository
+description		description of the repository
+index			directory cache
+
+ + \ No newline at end of file --- stgit-0.14.2.orig/debian/watch +++ stgit-0.14.2/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://homepage.ntlworld.com/cmarinas/stgit/ stgit-(.*)\.tar\.gz --- stgit-0.14.2.orig/debian/pyversions +++ stgit-0.14.2/debian/pyversions @@ -0,0 +1 @@ +2.4- --- stgit-0.14.2.orig/debian/stgit-contrib.install +++ stgit-0.14.2/debian/stgit-contrib.install @@ -0,0 +1,10 @@ +contrib/stg-dispatch usr/bin/ +contrib/stg-fold-files-from usr/bin/ +contrib/stg-gitk usr/bin/ +contrib/stg-k usr/bin/ +contrib/stg-mdiff usr/bin/ +contrib/stg-show usr/bin/ +contrib/stg-show-old usr/bin/ +contrib/stg-swallow usr/bin/ +contrib/stg-unnew usr/bin/ +contrib/stg-whatchanged usr/bin/