stgit
17 years agoAdd the 'autobcc' config option
Catalin Marinas [Fri, 27 Oct 2006 20:20:27 +0000 (21:20 +0100)]
Add the 'autobcc' config option

Useful to automatically bcc the e-mails to a given address.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd an optional prefix to the PATCH subject when mailing.
Robin Rosenberg [Fri, 27 Oct 2006 20:20:26 +0000 (21:20 +0100)]
Add an optional prefix to the PATCH subject when mailing.

This is for submitting patches to mailing lists with multiple
projects.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoRegression test for "stg assimilate"
Karl Hasselström [Wed, 25 Oct 2006 19:24:55 +0000 (20:24 +0100)]
Regression test for "stg assimilate"

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoNew stg command: assimilate
Karl Hasselström [Wed, 25 Oct 2006 19:24:55 +0000 (20:24 +0100)]
New stg command: assimilate

Introduce an "assimilate" command, with no options. It takes any GIT
commits committed on top of your StGIT patch stack and converts them
into StGIT patches.

Also change the error message when an StGIT command can't do its job
because there are GIT commits on top of the stack. Instead of
recommending "refresh -f", which is a destructive operation, recommend
"assimilate", which is not.

NOTE: "assimilate" currently refuses to work its magic if it
encounters a merge commit. This is reasonable, since merge commits
can't (yet) be represented as StGIT patches. However, it would be
possible (and well-defined) to replace the merge commit with a regular
commit on the branch with the same end result (tree object),
discarding all the parents that aren't on our branch. But this would
take a substantial amount of code, and is of dubious value, so for now
"assimilate" just cries bloody murder if it finds a merge.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoDisregard extraneous arguments when providing help
Karl Hasselström [Wed, 25 Oct 2006 19:24:54 +0000 (20:24 +0100)]
Disregard extraneous arguments when providing help

"stg --help pop" prints the help text for pop, but "stg --help pop
foo" just prints the list of commands. That's silly, so fix it by
simply ignoring the extra arguments.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoWhen no command was given, print usage message
Karl Hasselström [Wed, 25 Oct 2006 19:24:54 +0000 (20:24 +0100)]
When no command was given, print usage message

It's just silly to say "Unknown command" when the user didn't give a
command. Better to tell her to use a command.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoLet "stg help" be like "stg --help"
Karl Hasselström [Wed, 25 Oct 2006 19:24:54 +0000 (20:24 +0100)]
Let "stg help" be like "stg --help"

"stg --help" prints the list of commands, but "stg help" just prints
the usage message for the help command. This may be useful in theory,
but the distinction is probably lost on 95% of all users (and the
remaining 5% probably don't need to see the usage message for the help
command anyway, since they know how it works). So just make both
commands output the helpful command list.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoRelease 0.11 v0.11
Catalin Marinas [Sat, 21 Oct 2006 08:42:19 +0000 (09:42 +0100)]
Release 0.11

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd Debian package support to StGIT
Catalin Marinas [Fri, 20 Oct 2006 20:48:32 +0000 (21:48 +0100)]
Add Debian package support to StGIT

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoRearrange the patches with a given series file
Catalin Marinas [Fri, 20 Oct 2006 20:48:32 +0000 (21:48 +0100)]
Rearrange the patches with a given series file

This patch adds the --series option to the float command to reorder the
(top) patches as specified in a series file (or standard input).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd --auto option to 'mail'
Catalin Marinas [Fri, 20 Oct 2006 20:48:32 +0000 (21:48 +0100)]
Add --auto option to 'mail'

This option causes the mail command to automatically add the patch signers
to the Cc list. The patch also fixes the multiple To/Cc/Bcc lines
generation.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAllow the git-pull command to be configurable
Catalin Marinas [Fri, 20 Oct 2006 20:48:32 +0000 (21:48 +0100)]
Allow the git-pull command to be configurable

This way some people can use cg-pull instead. The patch also does some
clean-up in the example stgitrc file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd the diffcol.sh file to the contrib directory
Catalin Marinas [Fri, 20 Oct 2006 20:48:30 +0000 (21:48 +0100)]
Add the diffcol.sh file to the contrib directory

This script is a pager for colourifying the diff output. Copied from Quilt.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoNew command 'float' to move a patch to the top
Robin Rosenberg [Tue, 17 Oct 2006 18:39:53 +0000 (19:39 +0100)]
New command 'float' to move a patch to the top

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the --cover option.
Robin Rosenberg [Tue, 17 Oct 2006 18:37:26 +0000 (19:37 +0100)]
Fix the --cover option.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the preserving of the local changes during pop
Catalin Marinas [Tue, 17 Oct 2006 18:37:26 +0000 (19:37 +0100)]
Fix the preserving of the local changes during pop

The operation now only preserves the local changes by reverse-applying the
diff of the popped patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd --sign and --ack options to refresh
Catalin Marinas [Mon, 16 Oct 2006 18:36:49 +0000 (19:36 +0100)]
Add --sign and --ack options to refresh

These options automatically sign or acknowledge a patch.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd the '--interactive' option to 'resolved'
Catalin Marinas [Mon, 16 Oct 2006 18:36:49 +0000 (19:36 +0100)]
Add the '--interactive' option to 'resolved'

This options causes the 'resolved' command to run an interactive merge tool
like xxdiff or emacs, defined by the 'imerger' variable in the .stgitrc
config file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoTODO list update
Catalin Marinas [Fri, 15 Sep 2006 18:24:02 +0000 (19:24 +0100)]
TODO list update

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd the --noreply option to 'mail'
Catalin Marinas [Fri, 15 Sep 2006 18:24:02 +0000 (19:24 +0100)]
Add the --noreply option to 'mail'

There are mailing lists (ARM Linux Kernel is one of them) that filter out
e-mails having the In-Reply-To: header but a subject line not starting with
Re:. With this option, the mail command will not create the reply-specific
headers (the patch series will be unthreaded).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd patch history support
Catalin Marinas [Fri, 15 Sep 2006 18:24:02 +0000 (19:24 +0100)]
Add patch history support

The patch history tracking works by generating a chain of log commits for
the corresponding patch commits. A 'log' command is available to either
list the changelog or invoke gitk.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd the --graphical option to series
Catalin Marinas [Fri, 15 Sep 2006 18:24:01 +0000 (19:24 +0100)]
Add the --graphical option to series

This option invokes gitk on all the patches rather than printing the
series.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAllow empty commit messages
Catalin Marinas [Fri, 15 Sep 2006 18:24:01 +0000 (19:24 +0100)]
Allow empty commit messages

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd --keep option to pop
Catalin Marinas [Sun, 10 Sep 2006 13:58:54 +0000 (14:58 +0100)]
Add --keep option to pop

This option allows popping patches without affecting the working directory.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoUse get-ref-list to get the commit parents
Catalin Marinas [Sun, 10 Sep 2006 13:56:38 +0000 (14:56 +0100)]
Use get-ref-list to get the commit parents

Thanks to Yann Dirson for submitting the initial patch. The patch was
modified to only call git-rev-list when the commit parents are
required, otherwise operations like 'push' would be slowed down.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd a --parent flag to "stgit pick".
Yann Dirson [Mon, 14 Aug 2006 16:55:42 +0000 (18:55 +0200)]
Add a --parent flag to "stgit pick".

This is useful to pick changes from a non-stgit branch, that were
recorded as a merge commit, while giving control on the parent to
use as "bottom" for the patch (for some reason stgit selects the
first parent by default).

Incidentally, it can be used to pick changes between arbitrary
trees in the revision graph.  Since that can be useful as well,
I did not implement the is_parent check I originally meant to add.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoUse the ".." syntax for patch ranges
Catalin Marinas [Fri, 11 Aug 2006 16:32:33 +0000 (17:32 +0100)]
Use the ".." syntax for patch ranges

This patch also adapt the push/mail/diff/export commands to the new
syntax.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoSet the .txt extension to the StGIT commit message file
Catalin Marinas [Fri, 11 Aug 2006 16:32:31 +0000 (17:32 +0100)]
Set the .txt extension to the StGIT commit message file

The original extension was .msg which editors like emacs couldn't guess.
The patch changes it to .txt.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAutomatically generate patch names for uncommit
Catalin Marinas [Fri, 14 Jul 2006 16:25:36 +0000 (17:25 +0100)]
Automatically generate patch names for uncommit

This is the same as in the pick or import commands, the patch name, if not
specified, is automatically generated from the first line of the patch
description.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd a common function for reading template files
Catalin Marinas [Mon, 10 Jul 2006 21:21:22 +0000 (22:21 +0100)]
Add a common function for reading template files

Useful to search through various directories without duplicating the code.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd '--' to git-diff-index calls
Catalin Marinas [Wed, 5 Jul 2006 18:27:02 +0000 (19:27 +0100)]
Add '--' to git-diff-index calls

Without this, git-diff-index was confused about the command line arguments
and commands like 'push --undo' and 'status --reset' failed to work
properly.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoGet the patch name from the description
Catalin Marinas [Wed, 5 Jul 2006 18:27:02 +0000 (19:27 +0100)]
Get the patch name from the description

The import and pick commands can get the patch name from the patch
description if it wasn't passed on the command line or the patch is read
from the standard input (for import).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoDo not use the pager when the output is empty
Catalin Marinas [Wed, 5 Jul 2006 18:27:02 +0000 (19:27 +0100)]
Do not use the pager when the output is empty

This is for the diff and show commands to not run the output through the
pager if there is nothing to display.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoRelease 0.10 v0.10
Catalin Marinas [Sun, 11 Jun 2006 12:21:04 +0000 (13:21 +0100)]
Release 0.10

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoUpdate the TODO file
Catalin Marinas [Sun, 11 Jun 2006 12:21:02 +0000 (13:21 +0100)]
Update the TODO file

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the t0001-subdir-branches.sh test
Catalin Marinas [Sun, 11 Jun 2006 12:16:26 +0000 (13:16 +0100)]
Fix the t0001-subdir-branches.sh test

It was using 'stg add <file>' without any patches applied. This now fails.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the add and rm commands to fail if no patch is applied
Catalin Marinas [Sun, 11 Jun 2006 12:12:39 +0000 (13:12 +0100)]
Fix the add and rm commands to fail if no patch is applied

They were just adding the file without complaining.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoGenerate an empty commit for the newly created patches
Catalin Marinas [Sun, 11 Jun 2006 12:12:30 +0000 (13:12 +0100)]
Generate an empty commit for the newly created patches

This way, 'stg show' will no longer display the previous patch.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoShow the stderr for failed GIT commands
Catalin Marinas [Sun, 11 Jun 2006 12:05:56 +0000 (13:05 +0100)]
Show the stderr for failed GIT commands

This allows easier diagnosis of the faults.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the t1201-pull-trailing.sh test
Catalin Marinas [Sun, 11 Jun 2006 12:05:02 +0000 (13:05 +0100)]
Fix the t1201-pull-trailing.sh test

The test was expecting a failure but StGIT actually does a three-way merge
that succeeds.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoClassify commands in stg --help output.
Yann Dirson [Sun, 28 May 2006 21:25:19 +0000 (23:25 +0200)]
Classify commands in stg --help output.

Commands will be much easier to find out that way.
Inspiration mostly comes from pg-help.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd the --replace option to import
Catalin Marinas [Tue, 6 Jun 2006 18:15:13 +0000 (19:15 +0100)]
Add the --replace option to import

By default, import fails if an existing patch is found with the same name.
With this option, import replaces the existing patch if it is unapplied.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAllow to specify multiple patch names on push command-line
Yann Dirson [Sun, 28 May 2006 07:46:11 +0000 (08:46 +0100)]
Allow to specify multiple patch names on push command-line

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoImplement the 'goto' command
Catalin Marinas [Thu, 25 May 2006 20:38:10 +0000 (21:38 +0100)]
Implement the 'goto' command

Push/pop patches to/from the stack until the one given on the command
line becomes current. This is a shortcut for the 'push --to' or 'pop
--to' commands. There is no '--undo' option for 'goto'. Use the 'push'
command for this.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd the --update option to pick
Catalin Marinas [Wed, 24 May 2006 21:03:40 +0000 (22:03 +0100)]
Add the --update option to pick

This option updates the current patch with changes from the picked commit
or patch. This option is useful when work is done on a temporary patch but
the changes need to be folded back into existing patches. Note that
three-way merging is not supported with this option (I'm not sure it is
even needed).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoExplicitly specify utf-8 coding in file
Karl Hasselström [Wed, 24 May 2006 06:07:21 +0000 (08:07 +0200)]
Explicitly specify utf-8 coding in file

uncommit.py has a non-ascii character in it (in my name in the
copyright line). Without this coding: comment, I get an error like the
following when I run stgit:

  /home/kha/git/stgit/stgit/main.py:61: DeprecationWarning: Non-ASCII
  character '\xc3' in file
  /home/kha/git/stgit/stgit/commands/uncommit.py on line 3, but no
  encoding declared; see http://www.python.org/peps/pep-0263.html for
  details

17 years agoFix indexing error during "diff -r/"
Karl Hasselström [Wed, 24 May 2006 06:06:58 +0000 (08:06 +0200)]
Fix indexing error during "diff -r/"

The string indexing when decoding the -r argument for diff made an
implicit assumption that the revision string was at least two
characters long, which broke on the simple invocation "diff -r/".

17 years agoFix infinite recursion on absolute paths
Karl Hasselström [Wed, 24 May 2006 06:06:43 +0000 (08:06 +0200)]
Fix infinite recursion on absolute paths

Calling create_dirs with an absolute path caused infinite recursion,
since os.path.dirname('/') == '/'. Fix this by exiting early if the
given path already is a directory.

17 years agoTests for branch names with slashes
Karl Hasselström [Thu, 18 May 2006 20:36:41 +0000 (21:36 +0100)]
Tests for branch names with slashes

Test a number of operations on a repository that has branch names
containing slashes (that is, branches living in a subdirectory of
.git/refs/heads).

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoHandle branch names with slashes
Karl Hasselström [Thu, 18 May 2006 20:36:41 +0000 (21:36 +0100)]
Handle branch names with slashes

Teach stgit to handle branch names with slashes in them; that is,
branches living in a subdirectory of .git/refs/heads.

I had to change the patch@branch/top command-line syntax to
patch@branch//top, in order to get sane parsing. The /top variant is
still available for repositories that have no slashy branches; it is
disabled as soon as there exists at least one subdirectory of
refs/heads. Preferably, this compatibility hack can be killed some
time in the future.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoDon't die when there are no branches
Karl Hasselström [Thu, 18 May 2006 20:36:40 +0000 (21:36 +0100)]
Don't die when there are no branches

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoAllow configurable file extensions for merge conflicts
Catalin Marinas [Tue, 9 May 2006 20:21:28 +0000 (21:21 +0100)]
Allow configurable file extensions for merge conflicts

The files left after a merge conflict had confusing extensions. This patch
adds the "extensions" config option and also sets the defaults to
".ancestor", ".current" and ".patched".

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd a simple makefile
Pavel Roskin [Mon, 8 May 2006 20:22:06 +0000 (21:22 +0100)]
Add a simple makefile

Signed-off-by: Pavel Roskin <proski@gnu.org>
17 years agoAdd .gitignore files, list generated files there
Pavel Roskin [Mon, 8 May 2006 20:22:06 +0000 (21:22 +0100)]
Add .gitignore files, list generated files there

Signed-off-by: Pavel Roskin <proski@gnu.org>
17 years agoFix git.reset() to remove the added files
Catalin Marinas [Mon, 8 May 2006 20:21:22 +0000 (21:21 +0100)]
Fix git.reset() to remove the added files

The combination of git-read-tree and git-checkout-index used in the
git.checkout() function doesn't remove the files added to the index. This
patch adds the file removal support to the git.reset() function. It also
changes the git.apply_diff() call in stack.Series.merged_patches() so that
the the index is always updated (otherwise the reset wouldn't know which
files to remove).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the added to both but different conflict
Catalin Marinas [Wed, 3 May 2006 19:34:18 +0000 (20:34 +0100)]
Fix the added to both but different conflict

By default, the index was left with two unmerged entries. StGIT tries to
leave the index clean after conflicts.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAllow git.checkout() to work on unmerged indexes
Catalin Marinas [Wed, 3 May 2006 19:34:18 +0000 (20:34 +0100)]
Allow git.checkout() to work on unmerged indexes

If the index has unmerged entries, the current checkout implementation
fails because of the -m option. This patch removes the option since it is
not needed on tree_id is specified. This also allows "stg status --reset"
to work on unmerged indexes.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFixes to the pull testcases.
Yann Dirson [Wed, 3 May 2006 19:34:18 +0000 (20:34 +0100)]
Fixes to the pull testcases.

As mentionned earlier, the original testcases do not take --merged
into account.  Let's expect the push to fail without it, and succeed
with it.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoLook for templates in ~/.stgit/templates as well
Yann Dirson [Sun, 16 Apr 2006 10:52:46 +0000 (12:52 +0200)]
Look for templates in ~/.stgit/templates as well

This can be quite useful to avoid adding one's sig again and again to
ever covermail, and to use a patchmail template that insert
Signed-off-by lines, for those of us who prefer this to adding them to
commits.

Also make sure to use os.path.join() instead of hardcoded slashes.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoExercise "stg pull" on patches just appending lines.
Yann Dirson [Sun, 16 Apr 2006 10:52:44 +0000 (12:52 +0200)]
Exercise "stg pull" on patches just appending lines.

It indeed reveals a problem in "push": appended lines are appended
again, as the already-applied patch is not detected.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoTest that pulls a patch creating a file that got modified afterwards
Yann Dirson [Sun, 16 Apr 2006 20:40:29 +0000 (22:40 +0200)]
Test that pulls a patch creating a file that got modified afterwards

This demonstrates an issue wite has bitten me more than once: the stg
branch adds a file in one patch, and modifies it in a later patch; then all
patches get integrated in upstream tree, and at "stg pull" time, stgit
believes there is a conflict, even when the patches are exactly the same.

This is normal as it requires the --merged flag on push or pull.  So
we rollback with "push --undo" and "push --merge" to finish.

17 years agoFix a seriously bad interaction between .git caching and repo cloning
Yann Dirson [Sun, 16 Apr 2006 10:52:39 +0000 (12:52 +0200)]
Fix a seriously bad interaction between .git caching and repo cloning

Testcase 2 exhibits a problem with caching the location of .git while
cloning a repository.  Since basedir.get() is called before the clone is
built, a value may get stored in the cache if we are within a
git-controlled tree already.  Then when constructing the object for the
clone, a bogus .git is used, which can lead, when running tests in t/trash,
to corruption of the stgit .git repository.

Testcase 1 does not show any problem by chance, because since we have a
./.git prepared for use by the testsuite, value ".git" get cached, and it
happens that this value will be still valid after chdir'ing into the
newborn clone.

Clearing the cache at the appropriate place fixes the problem.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoCorrectly handle refs/patches on series rename
Yann Dirson [Sun, 16 Apr 2006 10:52:37 +0000 (12:52 +0200)]
Correctly handle refs/patches on series rename

When renaming a series, the refs/patches dir was not moved, and by
chance a new one was created by the repository-upgrade code, but that
left the old one behind as cruft (which the safety checks added in a
former patch now detects).

Also adds a regression test to assert that nothing by the old name
is left behind.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMake branch creation atomic
Yann Dirson [Sun, 16 Apr 2006 10:52:35 +0000 (12:52 +0200)]
Make branch creation atomic

This patch adds an optional create_at parameter to Series.init(), to
pass a git.branch_create() parameter if we want it to be called.  This
parameter can be None, so the test for False has to be explicit.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd a couple of safety checks to series creation
Yann Dirson [Sun, 16 Apr 2006 10:52:32 +0000 (12:52 +0200)]
Add a couple of safety checks to series creation

- we must check first whether the operation can complete, instead of
  bombing out halfway.  That means checking that nothing will prevent
  the creation of stgit data (note that calling is_initialised() is
  not enough, as it does not catch a bogus file), which is tested by
  the 3 first couple of testcases, and fixed in stack.py

- creating the git branch unconditionally before knowing whether
  creation of the stgit stuff can be completed is a problem as well:
  being atomic would be much much better.  To emulate atomicity (which
  comeds in the next patch), this patch does a somewhat dirty hack to
  branch.py: we first attempt to create the stgit stuff, and if that
  succeeds, we create the git branch: it is much easier to do at first
  a quick check that the latter will succeed.  Testcase 7/8 ensure
  that such a safety check has not been forgotten.

- when git already reports a problem with that head we would like to
  create, we should catch it.  Testcase 9/10 creates such a situation,
  and the fix to git.py allows to catch the error spit out by
  git-rev-parse.  I cannot tell why the stderr lines were not included
  by the Popen3 object.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd list of bugs to TODO
Yann Dirson [Sun, 16 Apr 2006 10:52:30 +0000 (12:52 +0200)]
Add list of bugs to TODO

Since there is no formal place to register bugs, other than the git
ml, I have added a couple of them, some of them already mentionned on
the ml but still around.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd a testsuite framework copied from git-core
Yann Dirson [Sun, 16 Apr 2006 10:52:28 +0000 (12:52 +0200)]
Add a testsuite framework copied from git-core

See git's t/README for details on how to use this framework.

There is no integration yet in the toplevel Makefile, I'll let
python masters take care of this.  Use "make -C t" to run the
tests for now.

A patch-naming policy should be defined for stgit, since the
git one does not apply.

Signed-off-by: Yann Dirson <ydirson@altern.org>
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>