stgit
18 years agoRelease 0.9 v0.9
Catalin Marinas [Fri, 7 Apr 2006 20:46:30 +0000 (21:46 +0100)]
Release 0.9

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse 'git-*' instead of 'git *'
Catalin Marinas [Thu, 6 Apr 2006 20:22:05 +0000 (21:22 +0100)]
Use 'git-*' instead of 'git *'

This is to avoid starting the shell twice, at least until the GIT people
decide to no longer support the 'git-*' commands.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse a pager for diff and show commands
Catalin Marinas [Fri, 31 Mar 2006 17:42:35 +0000 (18:42 +0100)]
Use a pager for diff and show commands

This patch also adds a pager configuration option that overrides the
default PAGER environment variable.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoRemove the basedir exception throwing
Catalin Marinas [Fri, 31 Mar 2006 17:42:34 +0000 (18:42 +0100)]
Remove the basedir exception throwing

This is preventing even 'clone' from working properly.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a 'show' command
Catalin Marinas [Fri, 31 Mar 2006 17:42:34 +0000 (18:42 +0100)]
Add a 'show' command

This command is similar to 'git show' only that it understands patch names
as well as normal commit ids.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the '--undo' option to 'refresh'
Catalin Marinas [Fri, 31 Mar 2006 17:42:34 +0000 (18:42 +0100)]
Add the '--undo' option to 'refresh'

This option is useful when adding the changes to the wrong patch (usually
instead of creating a new one).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoPass --directory to git-ls-files for stg status
Paolo 'Blaisorblade' Giarrusso [Wed, 29 Mar 2006 14:25:31 +0000 (16:25 +0200)]
Pass --directory to git-ls-files for stg status

Requires GIT 1.1.0 at least (don't know if this was backported in 1.0).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoAdd extra headers to the e-mail messages
Catalin Marinas [Tue, 28 Mar 2006 21:01:03 +0000 (22:01 +0100)]
Add extra headers to the e-mail messages

This patch adds the Content-Type, Content-Transfer-Encoding and User-Agent
headers to the e-mail messages.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoRemove the checking for the default configuration values
Catalin Marinas [Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)]
Remove the checking for the default configuration values

Since some options are set as defaults in stgit/config.py, there is no need
to check for their presence with config.has_option().

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCreate stgit/basedir.py for determining the .git directory
Catalin Marinas [Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)]
Create stgit/basedir.py for determining the .git directory

basedir.get() function is used in many files and leaving it only in
stgit.git caused some cyclic imports.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the "smtpdelay" config option
Catalin Marinas [Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)]
Add the "smtpdelay" config option

This option is similar to the --sleep option for the mail command, i.e. the
number of seconds between sending two consecutive patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoThe gitmergeonefile config section is deprecated
Catalin Marinas [Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)]
The gitmergeonefile config section is deprecated

Use [stgit] instead. For backward compatibility, also check the
[gitmergeonefile] section.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUpdate the TODO file
Catalin Marinas [Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)]
Update the TODO file

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the patch name stripping in import
Catalin Marinas [Sat, 25 Mar 2006 21:38:35 +0000 (21:38 +0000)]
Fix the patch name stripping in import

The current implementation was only stripping if both the prefix and the
extension were present.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the --strip option to import
Catalin Marinas [Thu, 16 Mar 2006 20:08:15 +0000 (20:08 +0000)]
Add the --strip option to import

This option strips the patch name of any leading numbering and .diff or
.patch extension. Useful when importing a series or local files. The export
command is able to automatically generate the numbering and extension.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the --patch option to export
Catalin Marinas [Thu, 16 Mar 2006 20:08:15 +0000 (20:08 +0000)]
Add the --patch option to export

This option appends the .patch extension to the generated patch names.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agocommon: parse 'email (name)' correctly
Sam Vilain [Thu, 9 Mar 2006 05:29:58 +0000 (18:29 +1300)]
common: parse 'email (name)' correctly

Currently only e-mails of the form "Name <email>" are accepted by
stgit import etc, however some people use "email (Name)".  Accept this
alternate form.

Signed-off-by: Sam Vilain <sam@vilain.net>
18 years agoImprove "stg uncommit" help text.
Pavel Roskin [Mon, 20 Feb 2006 17:18:14 +0000 (12:18 -0500)]
Improve "stg uncommit" help text.

Fix typos, rephrase some parts, describe in which order the patch names
are used.

Signed-off-by: Pavel Roskin <proski@gnu.org>
18 years agoDeal with merge conflicts directly
Catalin Marinas [Fri, 10 Mar 2006 21:44:44 +0000 (21:44 +0000)]
Deal with merge conflicts directly

This patch removes the need of calling the external git-merge-index and
gitmergeonefile.py. These are replaced by internal solving of the unmerged
stages in the index file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agogitmergeonefile.py should use git.get_base_dir()
Catalin Marinas [Thu, 9 Mar 2006 21:53:54 +0000 (21:53 +0000)]
gitmergeonefile.py should use git.get_base_dir()

... instead of assuming ".git".

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoPass the --aggressive flag to git-read-tree
Catalin Marinas [Thu, 9 Mar 2006 21:53:54 +0000 (21:53 +0000)]
Pass the --aggressive flag to git-read-tree

This flags solves the file removals which consumes the most time when
resolving the three-way merge conflicts.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCache the base_dir value for subsequent calls
Catalin Marinas [Thu, 9 Mar 2006 21:53:54 +0000 (21:53 +0000)]
Cache the base_dir value for subsequent calls

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd --series to import
Catalin Marinas [Fri, 3 Mar 2006 22:13:11 +0000 (22:13 +0000)]
Add --series to import

This option allows the importing of a Quilt series of patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a merged upstream test for pull and push
Catalin Marinas [Fri, 3 Mar 2006 22:13:11 +0000 (22:13 +0000)]
Add a merged upstream test for pull and push

This patch adds the --merged option to both pull and push commands. With
this option, these commands will first try to check which patches were
merged upstream by reverse-applying them in reverse order. This should
solve the situation where several patches modify the same line in a file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoPrint a shorter usage message with the --help option
Catalin Marinas [Wed, 1 Mar 2006 21:42:01 +0000 (21:42 +0000)]
Print a shorter usage message with the --help option

The --help option for a command should only print a one-line usage mesage
together with the options. The long command description is available
through the 'stg help <command>' command.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAllow stg to be loaded in pydb and not run main()
Catalin Marinas [Wed, 1 Mar 2006 21:41:55 +0000 (21:41 +0000)]
Allow stg to be loaded in pydb and not run main()

This patch adds the __name__ == '__main__' condition to stg*. It also adds
a stg-dbg file that starts pdb before invoking main().

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the reset command to set HEAD to a proper id
Catalin Marinas [Tue, 28 Feb 2006 21:57:35 +0000 (21:57 +0000)]
Fix the reset command to set HEAD to a proper id

By default, the git.reset() command was setting the head to the 'HEAD'
value (introduced by commit 15de5ae14f1c76adac52ca5633a679fba79a877c).
This patch fixes it and also adds an assert in the __set_head()
function to detect future bugs.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the e-mail address escaping
Catalin Marinas [Mon, 20 Feb 2006 21:26:22 +0000 (21:26 +0000)]
Fix the e-mail address escaping

This patch makes StGIT only escape the quotes in an e-mail address since
passing them unescaped as GIT_* environment variables can cause problems.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years ago[PATCH 2/2] Add 'stg uncommit' command
Karl Hasselstr\\Ã\\¶m [Sun, 19 Feb 2006 10:27:01 +0000 (10:27 +0000)]
[PATCH 2/2] Add 'stg uncommit' command

Add an uncommit command, which is exactly the opposite of 'stg
commit'.

Signed-off-by: Karl Hasselström <kha@treskal.com>
18 years agoAdd --mbox option to the 'mail' command
Catalin Marinas [Fri, 17 Feb 2006 21:31:45 +0000 (21:31 +0000)]
Add --mbox option to the 'mail' command

With this option, the mail command will dump the e-mails to standard output
in an mbox format. Useful to review the e-mails before sending.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd --stdout option to export
Catalin Marinas [Fri, 17 Feb 2006 21:31:45 +0000 (21:31 +0000)]
Add --stdout option to export

This option allows the 'export' command to write the patches to the
standard output. Useful for reviewing patches without writing them to
files.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUpdate .git/refs/heads/base after patch deletion
Karl Hasselstr\öm [Fri, 17 Feb 2006 21:31:44 +0000 (21:31 +0000)]
Update .git/refs/heads/base after patch deletion

Save the current HEAD into refs/heads/base if the stack is empty after
a patch has been deleted. This was not done before, which caused
refs/heads/base to not be updated after 'stg commit'. To guard against
existing repositories with no applied patches and HEAD !=
refs/heads/base, also do the update every time someone asks for the
name of refs/heads/base.

Signed-off-by: Karl Hasselström <kha@treskal.com>
18 years agoChange the signature start string to "-- \n"
Karl Hasselstr\öm [Fri, 17 Feb 2006 21:31:44 +0000 (21:31 +0000)]
Change the signature start string to "-- \n"

Change the signature start string from "--\n" to "-- \n" in the cover
mail template, as recommended in Mutt's manual:

    It is *strongly* recommended that you not unset this variable
    [from its default value of "-- \n"] unless your "signature"
    contains just your name. The reason for this is because many
    software packages use "-- \n" to detect your signature. For
    example, Mutt has the ability to highlight the signature in a
    different color in the builtin pager.

Signed-off-by: Karl Hasselström <kha@treskal.com>
18 years agoUse --refid option even when sending a cover mail
Karl Hasselstr\öm [Fri, 17 Feb 2006 21:31:44 +0000 (21:31 +0000)]
Use --refid option even when sending a cover mail

StGIT used to just ignore the --refid option when sending a cover
mail. With this patch, it will send the cover mail as a reply to the
mail identified by the refid, and the patch emails as replies to the
cover mail as usual.

Signed-off-by: Karl Hasselström <kha@treskal.com>
18 years agoAllow tag objects to be passed on the command line
Catalin Marinas [Fri, 17 Feb 2006 21:31:43 +0000 (21:31 +0000)]
Allow tag objects to be passed on the command line

stgit.common.git_id() was modified to add '^0' to the revision so that a
tag can be used for different operations and the corresponding commit will
be returned. Commands like 'branch --create' were failing if a tag was
passed.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd prune-safety to StGIT
Catalin Marinas [Mon, 13 Feb 2006 16:54:09 +0000 (16:54 +0000)]
Add prune-safety to StGIT

The top of each patch will also be stored in the .git/refs/patches/branch/
directory so that tools commands like git prune would not destroy the
unapplied patches. Since there is no support for patch history at the
moment, a git prune command would remove all the previous versions of a
patch (which were no longer accessible anyway).

The old repositories are automatically upgraded.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCheck whether the file exists in the fold command
Catalin Marinas [Sun, 5 Feb 2006 10:31:27 +0000 (10:31 +0000)]
Check whether the file exists in the fold command

This is to avoid an error reported by GIT.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse the GIT-specific environment as default
Catalin Marinas [Sun, 5 Feb 2006 09:45:21 +0000 (09:45 +0000)]
Use the GIT-specific environment as default

If the stgitrc files do not contain any information about the author or
committer, make StGIT use the GIT_* environment variables as defaults.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd an option to "stg branch" to convert the internal format
Chuck Lever [Sun, 29 Jan 2006 18:14:01 +0000 (13:14 -0500)]
Add an option to "stg branch" to convert the internal format

Previous patch adds support for a separate patch directory in each branch.
Let's give users an option to convert their old branches to new style ones
and back.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoUse a separate directory for patches under each branch subdir
Chuck Lever [Sun, 29 Jan 2006 18:13:59 +0000 (13:13 -0500)]
Use a separate directory for patches under each branch subdir

Currently you can't specify a patch name that matches the name of one of
the stgit special files under .git/patches/<branch-name>.  Let's use a
new subdirectory under .git/patches/<branch-name> to contain just the
patch directories to remove this limitation.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoTreat "stg --help cmd" and "stg help cmd" like "stg cmd
Pavel Roskin [Fri, 27 Jan 2006 05:17:28 +0000 (00:17 -0500)]
Treat "stg --help cmd" and "stg help cmd" like "stg cmd

User's intention is perfectly clear if "-h", "--help" or "help" is
followed by a valid command - show help for that command.

Signed-off-by: Pavel Roskin <proski@gnu.org>
18 years ago"stg pull" says "popping all patches" even when it doesn't
Chuck Lever [Sun, 29 Jan 2006 18:08:36 +0000 (13:08 -0500)]
"stg pull" says "popping all patches" even when it doesn't

Running "stg pull" says it pops all patches, but it really means it is
popping all *applied* patches.  Change the informational message to match
the behavior.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agostg export: check if there are any patches to export
Pavel Roskin [Tue, 24 Jan 2006 21:25:41 +0000 (16:25 -0500)]
stg export: check if there are any patches to export

Otherwise, stg export fails with "list index out of range"

Signed-off-by: Pavel Roskin <proski@gnu.org>
18 years agoAllow patch refreshing for some files only
Catalin Marinas [Mon, 23 Jan 2006 17:37:31 +0000 (17:37 +0000)]
Allow patch refreshing for some files only

The patch allows the 'refresh' command to accept files as arguments. Only
the local changes to the specified files will be considered for inclusion
in the patch to be refreshed.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoMerge branch 'master' of http://homepage.ntlworld.com/cmarinas/stgit
Catalin Marinas [Mon, 23 Jan 2006 14:37:16 +0000 (14:37 +0000)]
Merge branch 'master' of homepage.ntlworld.com/cmarinas/stgit

18 years agoRemove the --force option for new
Catalin Marinas [Sun, 22 Jan 2006 08:56:24 +0000 (08:56 +0000)]
Remove the --force option for new

The default behaviour is now the same as the previous 'new --force' since
most of the people (and myself) first change the tree and run 'new'
afterwards to create the patch. Note that the newly created patch is empty
even if there are local changes. A 'refresh' command is needed to add the
local changes to the patch.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the 'status --reset' for individual files
Catalin Marinas [Thu, 19 Jan 2006 15:01:29 +0000 (15:01 +0000)]
Fix the 'status --reset' for individual files

By default, status --reset calls resolved which updates the tree index and
the git-checkout-index -f does not overwrite the files anymore. This patch
explicitely resets the files to the HEAD tree id.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoMake tutorial a valid asciidoc article.
Pavel Roskin [Sat, 21 Jan 2006 22:21:59 +0000 (22:21 +0000)]
Make tutorial a valid asciidoc article.

There should be only one level 0 title, so redefine underline rules in
asciidoc.conf to keep the existing underlines when possible.  Form a new
level 1 part "Technical Information" from the text at the end.  Make
introduction a preamble - it's too short to be a level 1 section.

Add doc/Makefile to process the tutorial automatically.  make needs to
be run explicitly in the doc directory.

Signed-off-by: Pavel Roskin <proski@gnu.org>
18 years agoMerge branch 'master' of http://homepage.ntlworld.com/cmarinas/stgit
Catalin Marinas [Fri, 13 Jan 2006 10:25:28 +0000 (10:25 +0000)]
Merge branch 'master' of homepage.ntlworld.com/cmarinas/stgit

18 years agoFix the clone command failure
Catalin Marinas [Thu, 12 Jan 2006 21:04:30 +0000 (21:04 +0000)]
Fix the clone command failure

The clone command fails because there is no GIT tree available, which is
wrong. The patch fixes the Series.__init__() function and also creates a
new Series object in clone.py once a GIT tree was initialised.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agostgit: typo fixes
Pavel Roskin [Tue, 10 Jan 2006 17:14:00 +0000 (12:14 -0500)]
stgit: typo fixes

Signed-off-by: Pavel Roskin <proski@gnu.org>
18 years agoMerge branch 'master' of http://homepage.ntlworld.com/cmarinas/stgit
Catalin Marinas [Sat, 7 Jan 2006 11:45:08 +0000 (11:45 +0000)]
Merge branch 'master' of homepage.ntlworld.com/cmarinas/stgit

18 years agoStgit - gitmergeonefile.py: handle removal vs. changes
Paolo \'Blaisorblade\' Giarrusso [Sun, 13 Nov 2005 19:42:25 +0000 (20:42 +0100)]
Stgit - gitmergeonefile.py: handle removal vs. changes

I just got a "removal vs. changed" conflict, which is unhandled by StGit. That
is taken from git-merge-one-file resolver, but is bad, as stg resolved does not
handle unmerged entries (and probably it should be fixed too).

Sample patch included, but some thought must be done on it (see the comments I
left in).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years ago[trivial] fix spelling typos
Kirill Smelkov [Mon, 2 Jan 2006 11:26:02 +0000 (14:26 +0300)]
[trivial]  fix spelling typos

From: Kirill Smelkov <kirr@landau.phys.spbu.ru>

18 years agoMerge branch 'master' of http://homepage.ntlworld.com/cmarinas/stgit
Catalin Marinas [Fri, 23 Dec 2005 14:34:51 +0000 (14:34 +0000)]
Merge branch 'master' of homepage.ntlworld.com/cmarinas/stgit

18 years agoRelease 0.8 v0.8
Catalin Marinas [Fri, 23 Dec 2005 14:26:15 +0000 (14:26 +0000)]
Release 0.8

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years ago"status --reset" does not restore the deleted files
Catalin Marinas [Thu, 22 Dec 2005 14:26:42 +0000 (14:26 +0000)]
"status --reset" does not restore the deleted files

Actually, the broken code was restoring but deleting them. This was because
git.reset() command was used in the past instead of git.switch(). This
patch fixed it.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoX-Gmail-Received: cccbb3cdc84ae431fe07356861cbfa18540eab00
Catalin Marinas [Thu, 22 Dec 2005 22:17:39 +0000 (22:17 +0000)]
X-Gmail-Received: cccbb3cdc84ae431fe07356861cbfa18540eab00
Delivered-To: catalin.marinas@gmail.com
Received: by 10.70.27.12 with SMTP id a12cs9199wxa; Thu, 22 Dec 2005
        06:26:44 -0800 (PST)
Received: by 10.67.27.6 with SMTP id e6mr472488ugj; Thu, 22 Dec 2005
        06:26:43 -0800 (PST)
Return-Path: <Catalin.Marinas@arm.com>
Received: from cam-admin0.cambridge.arm.com (cam-admin0.cambridge.arm.com
        [193.131.176.58]) by mx.gmail.com with ESMTP id
        y1si659917uge.2005.12.22.06.26.43; Thu, 22 Dec 2005 06:26:43 -0800 (PST)
Received-SPF: pass (gmail.com: best guess record for domain of
        Catalin.Marinas@arm.com designates 193.131.176.58 as permitted sender)
Received: from cam-owa2.Emea.Arm.com (cam-owa2.emea.arm.com [10.1.255.63])
        by cam-admin0.cambridge.arm.com (8.12.10/8.12.10) with ESMTP id
        jBMEQ4JH025197 for <catalin.marinas@gmail.com>; Thu, 22 Dec 2005 14:26:04
        GMT
Received: from localhost.localdomain ([10.1.255.211]) by
        cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 22 Dec 2005
        14:26:42 +0000
From: Catalin Marinas <catalin.marinas@arm.com>
Subject: [PATCH] "status --reset" does not restore the deleted files
Date: Thu, 22 Dec 2005 14:26:42 +0000
To: catalin.marinas@gmail.com
Message-Id: <20051222142642.21281.82698.stgit@localhost.localdomain>
X-OriginalArrivalTime: 22 Dec 2005 14:26:42.0831 (UTC)
        FILETIME=[BAE209F0:01C60703]
X-Evolution-Source: pop://catalin.marinas@pop.gmail.com/
Mime-Version: 1.0

From: Catalin Marinas <catalin.marinas@gmail.com>

Actually, the broken code was restoring but deleting them. This was because
git.reset() command was used in the past instead of git.switch(). This
patch fixed it.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the import command when the body is empty
Catalin Marinas [Tue, 20 Dec 2005 13:20:36 +0000 (13:20 +0000)]
Fix the import command when the body is empty

When the description doesn't have a body, the import command generates an
exception.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUpdate the TODO information
Catalin Marinas [Fri, 16 Dec 2005 22:21:58 +0000 (22:21 +0000)]
Update the TODO information

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUpdate the tutorial
Catalin Marinas [Fri, 16 Dec 2005 22:21:43 +0000 (22:21 +0000)]
Update the tutorial

Used the latest information on the StGIT wiki (thanks to Chuck Lever for
updating it).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoremove formatting of git log entry on an imported patch
Trond Myklebust [Thu, 15 Dec 2005 22:36:59 +0000 (22:36 +0000)]
remove formatting of git log entry on an imported patch

The latest stgit changeset appears to reformat patch descriptions on
import (stripping whitespace and adding newlines). I personally much
prefer to be able to control the git log entry myself rather than have a
program dictate the format to me.

The patch also adds support for Date: and From: lines both before and
after the subject (that is a less important change, and can be split out
or thrown out if you prefer).

Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
18 years agoMake StGIT comply with the author information retrieving
Catalin Marinas [Sun, 11 Dec 2005 09:46:52 +0000 (09:46 +0000)]
Make StGIT comply with the author information retrieving

The import command should search for a "From:" line in the body of the mail
(or patch description) and use the author information from there. The
export and mail commands should automatically add a "From:" line to the
patch description.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoRemove "-r" option on invocations of git-diff-index
Chuck Lever [Thu, 8 Dec 2005 01:48:34 +0000 (20:48 -0500)]
Remove "-r" option on invocations of git-diff-index

Clean-up: the "-r" option on git-diff-index has no effect, and is now
undocumented.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a brief sentence to the documentation of the "stg branch" command.
Chuck Lever [Thu, 8 Dec 2005 01:48:32 +0000 (20:48 -0500)]
Add a brief sentence to the documentation of the "stg branch" command.

Add a sentence explaining the default behavior of the "stg branch" command.
Idea by J. Bruce Fields.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a "--clone" option to "stg branch"
Chuck Lever [Sun, 4 Dec 2005 03:50:19 +0000 (22:50 -0500)]
Add a "--clone" option to "stg branch"

Cloning a branch means creating a new branch and copying all of the
original branch's patches and its base to it.  Like creating a tag,
but this also preserves all the StGIT patches as well.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFast-forwarding does a git.switch() even when it forwarded no patches
Chuck Lever [Fri, 2 Dec 2005 00:15:13 +0000 (19:15 -0500)]
Fast-forwarding does a git.switch() even when it forwarded no patches

The git.switch() in forward_patches() is not needed when no patches have
been fast forwarded.  This is a significant speed up.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoMake "stg export" save the base commit in the output directory
Chuck Lever [Thu, 1 Dec 2005 02:40:19 +0000 (21:40 -0500)]
Make "stg export" save the base commit in the output directory

When trying to apply a series of diffs that was exported from an StGIT
series, it can be convenient to know exactly which base commit the
patches apply to.  Save that commit as a comment in the "series" file.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd facility to print short list of patches around 'top'
Chuck Lever [Tue, 29 Nov 2005 22:09:47 +0000 (17:09 -0500)]
Add facility to print short list of patches around 'top'

When working in the middle of a very long series, I often find it useful
to have a list of the patches right around the current patch.  Add an
option to "stg series" called "--short" to provide this short list.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago"stg series" option to show patch summary descriptions
Chuck Lever [Tue, 29 Nov 2005 22:09:45 +0000 (17:09 -0500)]
"stg series" option to show patch summary descriptions

Optionally show each patch's short description when listing a series.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoUse git-rev-parse to find the local GIT repository
Chuck Lever [Tue, 29 Nov 2005 22:09:40 +0000 (17:09 -0500)]
Use git-rev-parse to find the local GIT repository

Use the latest git-rev-parse technology to allow some StGIT commands to
function correctly in subdirectories of the working directory.

Any command that relies on git-read-tree still doesn't work (changes to
GIT forthcoming).

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAlign branch descriptions in output of "stg branch -l"
Chuck Lever [Tue, 29 Nov 2005 22:09:43 +0000 (17:09 -0500)]
Align branch descriptions in output of "stg branch -l"

When printing branch descriptions, start descriptions in the same column.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAllow 'stg status --reset' to work on individual files
Catalin Marinas [Fri, 18 Nov 2005 16:13:05 +0000 (16:13 +0000)]
Allow 'stg status --reset' to work on individual files

It is useful to be able to only reset some files. This patch allows this.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the unapplied variable missing in export.py
Catalin Marinas [Fri, 18 Nov 2005 13:18:08 +0000 (13:18 +0000)]
Fix the unapplied variable missing in export.py

The bug was introduced by a previous patch for better error reporting.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUsing delete_patch while deleting a branch is broken
Chuck Lever [Thu, 17 Nov 2005 02:39:30 +0000 (21:39 -0500)]
Using delete_patch while deleting a branch is broken

"stg branch --force --delete" takes forever, and often leaves the
repository in a broken state.  The reason for this is the use of
stack.delete_patch() to delete the patches before removing the series.

The problem is delete_patch() will try to pop the patches, which changes
the head link.  After the branch deletion is complete, HEAD will point to
.git/refs/heads/current-branch, but the contents of current-branch will be
the old base of the deleted branch.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoSeamlessly allow diffs "from" the current working directory
Chuck Lever [Tue, 15 Nov 2005 22:58:47 +0000 (17:58 -0500)]
Seamlessly allow diffs "from" the current working directory

Sometimes I get a big patch B (say it applies to a tree T) that I
want to split up into smaller patches P_1,...,P_n.  Say I've written
patches P_1 and P_2 so far. I'd like a quick way to generate a diff
between T + P_1 + P_2 and T + B, to see what's left to be done.

Currently I use a dirty trick that depends on editing backup files
directly.  If stg already stores trees with the results of applying the
currently unapplied patches, then a way to diff my working tree with one
of those would do the job.

OK, I wrote the above and then discovered:
stg diff -r patchname/top

Does what I want, except reversed.  OK, so stg diff is nifty.  I could
do it with the following patch that changes the empty string to refer to
the current working directory instead of the top of the last applied
patch.  Then

stg diff -r :patchname/top

gives what I want.  Since "/" is already available to refer to the top
of the last applied patch, it makes more sense to me to allow "" for the
current working directory anyway.

IE, there's no way to explicitly refer to the current working directory.
So the only way to get diffs with the current working directory is with a
-r argument that has no colon or trailing slash, in which case you get a
diff *to* the current working directory.

So my proposal gives you an explicit way to refer to the cwd--the empty
string, "".  That seems like a fairly symmetric way to do things, and it
takes advantage of the unused syntax ":patchname" which currently just
gives an error.

Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoClean up StGIT's "branch --delete" command
Chuck Lever [Tue, 15 Nov 2005 22:52:56 +0000 (17:52 -0500)]
Clean up StGIT's "branch --delete" command

os.path.isfile is not the same as os.path.exists.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoCleanup: remove unused variable
Chuck Lever [Tue, 15 Nov 2005 22:52:54 +0000 (17:52 -0500)]
Cleanup: remove unused variable

Get rid of git.py:head_link , as it is no longer used by any part of
StGIT.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix a typo in the "add" command's documentation
Chuck Lever [Mon, 14 Nov 2005 16:51:02 +0000 (11:51 -0500)]
Fix a typo in the "add" command's documentation

Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix a typo in "stg pick"
Chuck Lever [Mon, 14 Nov 2005 16:50:59 +0000 (11:50 -0500)]
Fix a typo in "stg pick"

"Unknown" is misspelled.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agouse "crt_series.get_branch()" instead of "git.get_head_file()"
Chuck Lever [Mon, 14 Nov 2005 16:50:57 +0000 (11:50 -0500)]
use "crt_series.get_branch()" instead of "git.get_head_file()"

More cleanup to the branch command.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoBetter error message when renaming patches to same name
Chuck Lever [Mon, 14 Nov 2005 16:50:55 +0000 (11:50 -0500)]
Better error message when renaming patches to same name

Generate a more precise error message when trying to rename a patch to the
same name.  This is what we get currently:

  [cel@dexter main]$ stg rename nfs_direct_wait nfs_direct_wait
  Renaming patch "nfs_direct_wait" -> "nfs_direct_wait"...stg rename: Patch
  "nfs_direct_wait" already exists

  [cel@dexter main]$

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix the --name option for the pick command
Catalin Marinas [Fri, 11 Nov 2005 10:12:46 +0000 (10:12 +0000)]
Fix the --name option for the pick command

If a patch name from a different branch is given, the --name option is
ignored.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise pick --fold to use git-apply first
Catalin Marinas [Thu, 10 Nov 2005 14:28:42 +0000 (14:28 +0000)]
Optimise pick --fold to use git-apply first

If "git-diff-tree | git-apply" fails, the command falls back to a
three-way merge.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoDifferent fixes for the branch command
Catalin Marinas [Wed, 9 Nov 2005 21:57:38 +0000 (21:57 +0000)]
Different fixes for the branch command

Mainly checks for local changes were added and some typos.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoGeneralize branch renaming
Chuck Lever [Sat, 5 Nov 2005 22:47:06 +0000 (17:47 -0500)]
Generalize branch renaming

The Series object already has the path names of all the pieces we need to
rename, so let's reuse that information.  Extract the rename branch logic
from the "stg branch" command and put it in stack.py.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a stack method for determining whether a branch is initialised
Chuck Lever [Wed, 2 Nov 2005 21:55:46 +0000 (16:55 -0500)]
Add a stack method for determining whether a branch is initialised

Let's be consistent about how we decide whether a branch is ready for use
by stgit.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoReplace a variable that uses the same name as a built-in
Chuck Lever [Wed, 2 Nov 2005 21:55:42 +0000 (16:55 -0500)]
Replace a variable that uses the same name as a built-in

Maintainability: "str" hides the name of a Python built-in function
(found by pychecker).

I've also replaced the use of the variable "string" throughout, as it
hides the name of the Python 'string' module.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix up help string for "stg clone"
Chuck Lever [Wed, 2 Nov 2005 21:55:39 +0000 (16:55 -0500)]
Fix up help string for "stg clone"

The help string for "stg clone" is the same as the one for "stg pull".

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago"stg export" error message could be more specific
Chuck Lever [Wed, 2 Nov 2005 21:55:37 +0000 (16:55 -0500)]
"stg export" error message could be more specific

Like similar previous patches, make "stg export" distinguish between an
unapplied patch and a non-existent one when reporting a failure.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoremove extra refresh_index() call in apply_patches()
Chuck Lever [Wed, 2 Nov 2005 21:55:35 +0000 (16:55 -0500)]
remove extra refresh_index() call in apply_patches()

apply_patches() calles git.merge() and git.switch(), both of which already
invoke refresh_index().

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a space after ',' when building the e-mail recipients headers
Catalin Marinas [Fri, 4 Nov 2005 17:33:50 +0000 (17:33 +0000)]
Add a space after ',' when building the e-mail recipients headers

This patch also untabifies the mail.py file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise the export command
Catalin Marinas [Fri, 4 Nov 2005 16:05:09 +0000 (16:05 +0000)]
Optimise the export command

This patch replaces the call to git_id with patch.get_(top|bottom).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a patches command
Catalin Marinas [Fri, 4 Nov 2005 16:05:06 +0000 (16:05 +0000)]
Add a patches command

This command shows the patches that modify a given file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the 'files' initialisation in git.checkout()
Catalin Marinas [Fri, 4 Nov 2005 10:27:22 +0000 (10:27 +0000)]
Fix the 'files' initialisation in git.checkout()

The 'files' variable should have been initialised to an empty list, not
None. Thanks to Kai Ruemmler for spotting it.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUsing a mutable default function argument is bad
Chuck Lever [Wed, 26 Oct 2005 18:51:54 +0000 (14:51 -0400)]
Using a mutable default function argument is bad

Python function arguments can have default values.  These values are
objects that are created when the "def" statement is run, not when the
function is called.  These objects are thus persistent across calls to
that function.  If a mutable object, such as a list, is used as a
default argument, that object will retain its value across function
calls.  This is potentially unwanted behavior if the function is called
multiple times.

Fix up function argument defaults in stgit/git.py, for safety.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd an option to delete a patch from a certain branch
Paolo \'Blaisorblade\' Giarrusso [Mon, 31 Oct 2005 20:54:47 +0000 (21:54 +0100)]
Add an option to delete a patch from a certain branch

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Actually, simply adding the option is enough...
Restrict print_crt_patch() to the case when we didn't specify --branch (as it's
useless otherwise).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoCapture the KeyboardInterrupt exception
Catalin Marinas [Thu, 27 Oct 2005 19:47:25 +0000 (20:47 +0100)]
Capture the KeyboardInterrupt exception

This is to avoid a stack back-trace when a command is interrupted by the
user.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoNotify when a cherry-picked commit was modified by 'pick'
Catalin Marinas [Thu, 27 Oct 2005 19:47:24 +0000 (20:47 +0100)]
Notify when a cherry-picked commit was modified by 'pick'

The logic is similar to the 'push' command one (i.e. it is reported as
modified if a three-way merge is needed).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoNotify when a patch was modified during a push operation
Catalin Marinas [Thu, 27 Oct 2005 19:47:24 +0000 (20:47 +0100)]
Notify when a patch was modified during a push operation

The logic of this is that when a "git-diff | git-apply" succeeds, the patch
is reported as unmodified. If the the above operation fails and the command
falls back to a three-way merge, the patch will be reported as modified.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>