stgit
17 years agoFix config caching so that get, set, get works
Karl Hasselström [Mon, 21 May 2007 20:58:38 +0000 (21:58 +0100)]
Fix config caching so that get, set, get works

The config caching was never invalidated or updated, which caused the
two gets to always return the same value regardless of the value
passed to set.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoRemove obsolete files when deleting a branch
Karl Hasselström [Tue, 15 May 2007 19:38:40 +0000 (21:38 +0200)]
Remove obsolete files when deleting a branch

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoStore branch description in the config file
Karl Hasselström [Tue, 15 May 2007 17:10:02 +0000 (18:10 +0100)]
Store branch description in the config file

Instead of storing the branch description in an StGIT-specific file,
store it in the git config file, where tools other than StGIT can read
and write it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoUse list comprehension in uncommit.py for Python 2.3
Catalin Marinas [Tue, 15 May 2007 17:10:02 +0000 (18:10 +0100)]
Use list comprehension in uncommit.py for Python 2.3

The (None for ...) is not allowed in Python 2.3. Changed to [...]

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoUncommit to a named commit
Karl Hasselström [Tue, 15 May 2007 17:10:02 +0000 (18:10 +0100)]
Uncommit to a named commit

Add a new flag to "stg uncommit": --to. This flag takes a committish
parameter, and uncommits everything up until that commit.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoIf any uncommit would fail, don't uncommit anything
Karl Hasselström [Tue, 15 May 2007 17:10:01 +0000 (18:10 +0100)]
If any uncommit would fail, don't uncommit anything

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoRemove an unnecessary parameter to make_patch_name
Karl Hasselström [Tue, 15 May 2007 17:10:00 +0000 (18:10 +0100)]
Remove an unnecessary parameter to make_patch_name

The "alternative" parameter was a boolean that indicated whether we
were interested in testing if the first generated name was acceptable,
or if we would just always accept it. But that can be accomplished by
giving an "unacceptable" function that always returns False, so
there's no need for an additional parameter.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoGenerate patch names of more uniform length
Karl Hasselström [Tue, 15 May 2007 17:10:00 +0000 (18:10 +0100)]
Generate patch names of more uniform length

Cut the generated patch name at 30 characters after getting rid of
unwanted characters, not before. This gives patch names of more
uniform length, since consecutive unwanted characters were replaced by
a single dash.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoMake the "name" argument to "stg new" optional
Karl Hasselström [Tue, 15 May 2007 17:09:59 +0000 (18:09 +0100)]
Make the "name" argument to "stg new" optional

If no name is given, one is generated from the commit message. This
can be very handy.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoRename "bury" back to "sink".
Yann Dirson [Tue, 15 May 2007 17:09:58 +0000 (18:09 +0100)]
Rename "bury" back to "sink".

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoStop recording branch.*.remote to '.' for local parents.
Yann Dirson [Tue, 15 May 2007 17:09:57 +0000 (18:09 +0100)]
Stop recording branch.*.remote to '.' for local parents.

We should be using the remote name of the remote branch in
branch.*.merge, instead of the local one as we currently do (I'll
ensure this in a later patch).

As a consequence, setting "remote" to '.' and "merge" to the name of a
*local* parent would become inconsistent with the remote case.  Anyway
the local case should make use of pull-policy=rebase instead, and this
change revealed that we were fetching useless information in the local
case (no need for a remote).

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix typo in the patchlogs copying code
Catalin Marinas [Tue, 15 May 2007 17:09:55 +0000 (18:09 +0100)]
Fix typo in the patchlogs copying code

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoStore branch description in the config file
Karl Hasselström [Mon, 14 May 2007 19:28:10 +0000 (21:28 +0200)]
Store branch description in the config file

Instead of storing the branch description in an StGIT-specific file,
store it in the git config file, where tools other than StGIT can read
and write it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoUse "stg applied" instead of reading the applied file directly
Karl Hasselström [Sun, 13 May 2007 18:27:30 +0000 (20:27 +0200)]
Use "stg applied" instead of reading the applied file directly

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoTest patch order, not just number of patches
Karl Hasselström [Sun, 13 May 2007 18:27:25 +0000 (20:27 +0200)]
Test patch order, not just number of patches

In addition to testing the number of applied patches, also test their
order. And test the order of unapplied patches too while we're at it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoMake patch deletion test more specific
Karl Hasselström [Sun, 13 May 2007 18:27:20 +0000 (20:27 +0200)]
Make patch deletion test more specific

Don't just test the number of applied and unapplied patches; also test
their name and order.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoDocument patch syntax.
Yann Dirson [Sun, 13 May 2007 14:11:54 +0000 (16:11 +0200)]
Document patch syntax.

Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMake the "name" argument to "stg new" optional
Karl Hasselström [Fri, 11 May 2007 01:40:05 +0000 (03:40 +0200)]
Make the "name" argument to "stg new" optional

If no name is given, one is generated from the commit message. This
can be very handy.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoFix popping on non-active branches
Karl Hasselström [Tue, 8 May 2007 23:32:46 +0000 (01:32 +0200)]
Fix popping on non-active branches

Resetting HEAD on the current branch when popping a patch on another
branch isn't a great idea.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoTeach bash to complete branch names in some places.
Yann Dirson [Sun, 6 May 2007 23:13:57 +0000 (01:13 +0200)]
Teach bash to complete branch names in some places.

This patch causes bash completion to look for branch names instead of
patch names for "branch" and "rebase".

Unfortunately, the current completion framework does not seem flexible
enough to get branch completion after "-b" flags, but I feel things
are already better this way.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoDon't use patches/<branch>/current
Karl Hasselström [Sun, 6 May 2007 15:13:44 +0000 (17:13 +0200)]
Don't use patches/<branch>/current

The name of the current patch, if any, is always the last line of
patches/<branch>/applied (and there is no current patch if and only if
the "applied" file is empty). So use that instead, and stop having to
worry about keeping the redundant "current" file up-to-date.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoCopy patchlogs when cloning a stack or picking a patch.
Yann Dirson [Sat, 5 May 2007 14:00:28 +0000 (16:00 +0200)]
Copy patchlogs when cloning a stack or picking a patch.

This will allow to keep patch history accross those operations, and
see when they diverged when looking at the respective patchlogs.  With
more work, that will allow to locate the common ancestor when sync'ing
a patch across branches.

The work on "pick" can still be improved: currently the patchlog is
preserved on "pick patch[@branch][//top]", but we could make it work
for //top.old as well (or any rev in the patchlog when we'll be able
to name those).

Patchlog preservation in pick can only work when referencing a patch
by name.  When picking an arbitrary commit we could also improve
things by recording a "pick" operation instead of a "new".

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoCleanup variable names in pick.
Yann Dirson [Sat, 5 May 2007 14:00:23 +0000 (16:00 +0200)]
Cleanup variable names in pick.

I'm going to need patch objects there, so avoid using variable "patch"
to store only a patchname.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAvoid contrib/stg-swallow deleting unrelated empty patches.
Yann Dirson [Sat, 5 May 2007 13:58:07 +0000 (15:58 +0200)]
Avoid contrib/stg-swallow deleting unrelated empty patches.

Let's just check ourselves if the patch is empty after pushing instead
of using clean: no more surprise with patches getting abusively
cleaned, and we should now be faster when there are many unapplied
patches.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix deleting series trash directory
Roland Dreier [Thu, 3 May 2007 18:29:41 +0000 (11:29 -0700)]
Fix deleting series trash directory

When deleting a series, the loop that iterates through the files in
__trash_dir needs to add __trash_dir to the filename that it passes to
os.remove().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoDon't use refs/bases/<branchname>
Karl Hasselström [Sun, 29 Apr 2007 22:15:52 +0000 (00:15 +0200)]
Don't use refs/bases/<branchname>

It's silly to save the stack base in a ref when it can trivially be
computed from the bottommost applied patch, if any. (If there are no
applied patches, it's simply equal to HEAD.)

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agodash doesn't do curly brace expansion, so avoid that
Karl Hasselström [Sun, 29 Apr 2007 21:09:55 +0000 (23:09 +0200)]
dash doesn't do curly brace expansion, so avoid that

I have dash as /bin/sh, and it doesn't seem to expand stuff in curly
braces, which breaks t1800. Work around this by not using curly brace
expansion to generate test data.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoString comparison is done with "=", not "=="
Karl Hasselström [Sun, 29 Apr 2007 21:09:50 +0000 (23:09 +0200)]
String comparison is done with "=", not "=="

The "test" builtin in bash accepts both "==" and "=", but it didn't
work with dash as /bin/sh.

Signed-off-by: Karl Hasselström <kha@treskal.com>
17 years agoFailed recursive merging can silently lose date in StGIT
Catalin Marinas [Tue, 17 Apr 2007 16:29:32 +0000 (17:29 +0100)]
Failed recursive merging can silently lose date in StGIT

The logic in git.merge(recursive = True) is that if
git-merge-recursive fails, deal with the unmerged entries via diff3
and interactive merge (if 'autoimerge' is set to 'yes' in
config). There is a situation, however, when git-merge-recursive fails
because of an untracked file that would be overwritten by the
merge. In this case, git-merge-recursive aborts the operation but
without any unmerged entries in the index. StGIT considers that the
merge lead to an empty patch without reporting any error.

This commit makes it a bit safer by detecting whether there are
unmerged index entries and, if not, further raises an error informing
the user of the problem. The patch is still pushed as empty but the
user is informed of the failure and the possibility of running 'push
--undo'.

A better solution, but which require a bit more work, is to
distinguish between the merge failures and, in this specific case,
abort the push completely and revert the patch to its original state
(and popped from the stack).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoDocument the new 'stg branch --description' features.
Yann Dirson [Thu, 12 Apr 2007 20:15:36 +0000 (22:15 +0200)]
Document the new 'stg branch --description' features.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoRevert commit "Move man page stg(1) to stg(7)"
Catalin Marinas [Wed, 11 Apr 2007 23:01:10 +0000 (00:01 +0100)]
Revert commit "Move man page stg(1) to stg(7)"

This commit is reverting 5906924135f886527c1e947d100073067783eaa2 and
also moves stg.txt to section 1 in Documentation/Makefile.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the 'bury' command completion to include all patches
Catalin Marinas [Wed, 11 Apr 2007 23:01:10 +0000 (00:01 +0100)]
Fix the 'bury' command completion to include all patches

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoMove man page stg(1) to stg(7)
Catalin Marinas [Tue, 10 Apr 2007 22:09:17 +0000 (23:09 +0100)]
Move man page stg(1) to stg(7)

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd "stg bury" command, with the functionality of contrib/stg-sink.
Yann Dirson [Tue, 10 Apr 2007 18:27:02 +0000 (20:27 +0200)]
Add "stg bury" command, with the functionality of contrib/stg-sink.

This is the rewrite in python of by stg-sink written in perl.

I changed the name to "bury" since it seems more descriptive of what
it does, despite being less of an opposite to "float" than "sink" was.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd --description option to branch
Catalin Marinas [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Add --description option to branch

This options allows one to set the description text of a branch.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoStop advertising 'pull' as the only operation blocked on protected stacks.
Yann Dirson [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Stop advertising 'pull' as the only operation blocked on protected stacks.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMake the documentation of options more consistent.
Yann Dirson [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Make the documentation of options more consistent.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix doc cross-refs.
Yann Dirson [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Fix doc cross-refs.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd doc for 'branch'.
Yann Dirson [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Add doc for 'branch'.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd doc for 'clone' and 'init'.
Yann Dirson [Tue, 10 Apr 2007 21:47:10 +0000 (22:47 +0100)]
Add doc for 'clone' and 'init'.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoDon't use section 7 for main manpage.
Yann Dirson [Tue, 10 Apr 2007 21:47:09 +0000 (22:47 +0100)]
Don't use section 7 for main manpage.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix typo in help string.
Yann Dirson [Tue, 10 Apr 2007 21:47:09 +0000 (22:47 +0100)]
Fix typo in help string.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoCleanup parent information on stgit branch deletion.
Yann Dirson [Fri, 16 Mar 2007 22:45:45 +0000 (22:45 +0000)]
Cleanup parent information on stgit branch deletion.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd support for unsetting config vars.
Yann Dirson [Fri, 16 Mar 2007 22:45:45 +0000 (22:45 +0000)]
Add support for unsetting config vars.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd a script to quickly run an interactive test session.
Yann Dirson [Fri, 16 Mar 2007 22:45:45 +0000 (22:45 +0000)]
Add a script to quickly run an interactive test session.

This uses the capabilities of the test library to provide a throw-away
playground to test how the current stgit tree behaves.

To use it, run the following command:
(cd t && ./interactive.sh)

You'll get a shell in a brand new git tree.  Exiting that shell will
get rid of this temporary directory.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoRemove debugging output from contrib/stg-sink
Yann Dirson [Fri, 16 Mar 2007 22:45:45 +0000 (22:45 +0000)]
Remove debugging output from contrib/stg-sink

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoCopy parentbranch setting on 'stg branch --clone'.
Yann Dirson [Fri, 16 Mar 2007 22:45:44 +0000 (22:45 +0000)]
Copy parentbranch setting on 'stg branch --clone'.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoDrop utils.remove_dirs() in favor of os.removedirs().
Yann Dirson [Fri, 16 Mar 2007 22:45:44 +0000 (22:45 +0000)]
Drop utils.remove_dirs() in favor of os.removedirs().

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMake use exception raised by removedirs.
Yann Dirson [Fri, 16 Mar 2007 22:45:44 +0000 (22:45 +0000)]
Make use exception raised by removedirs.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix diagnostic messages on patch deletion and simplify others.
Yann Dirson [Fri, 16 Mar 2007 22:45:44 +0000 (22:45 +0000)]
Fix diagnostic messages on patch deletion and simplify others.

Also make use standard os.removedirs(), allowing for the same
simplification.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix stack deletion when orig-base is present.
Yann Dirson [Fri, 16 Mar 2007 22:45:43 +0000 (22:45 +0000)]
Fix stack deletion when orig-base is present.

The introduction of the orig-base file makes the stack deletion fail
to remove the stack's directory, leaving the stack in a zombie state,
where attempting to recreate it was refused because of the directory
already existing, but attempting to delete it failed since the applied
and unapplied files were not found.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd an empty line before signed-off-by
Robin Rosenberg [Fri, 16 Mar 2007 22:45:43 +0000 (22:45 +0000)]
Add an empty line before signed-off-by

Default to the standard convention of having an empty line
before the Signed-off line when addign a signature using the
--sign option.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFixed t2102-pull-policy-rebase to really test 'rebase' policy.
Yann Dirson [Mon, 12 Mar 2007 22:44:22 +0000 (22:44 +0000)]
Fixed t2102-pull-policy-rebase to really test 'rebase' policy.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMake 'stg cp' 2nd form safe.
Yann Dirson [Mon, 12 Mar 2007 22:44:21 +0000 (22:44 +0000)]
Make 'stg cp' 2nd form safe.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoSome clarifications to the main doc.
Yann Dirson [Mon, 12 Mar 2007 22:44:21 +0000 (22:44 +0000)]
Some clarifications to the main doc.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoDo not link to docs that will never be written.
Yann Dirson [Mon, 12 Mar 2007 22:44:21 +0000 (22:44 +0000)]
Do not link to docs that will never be written.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd 'stg cp' command.
Yann Dirson [Mon, 12 Mar 2007 22:44:21 +0000 (22:44 +0000)]
Add 'stg cp' command.

Supports copying several files and dirs into existing dir, as well as
copying single file or dir with a new name.

In the case of directory copying, only copies files known to git (ie,
no generated files).  Should maybe add --all as alternative.

Does not check whether we're going to lose data (overwriting any
modified file, or any file not tracked by git).  This should probably
be done first, before doing any real change (preparing the changes
in-memory, then do the work if OK).  Will give us --dry-run at no
additional cost.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoOnly check for upstream merges if not fast-forwarding
Catalin Marinas [Mon, 12 Mar 2007 22:44:20 +0000 (22:44 +0000)]
Only check for upstream merges if not fast-forwarding

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years ago[Revert] Make 'push --undo' safer
Catalin Marinas [Thu, 7 Dec 2006 22:02:42 +0000 (22:02 +0000)]
[Revert] Make 'push --undo' safer

(reverting of commit 539fb2921209bd3fd6165baa057f76f474aa5cb4)

Make the push undoing a bit safer by asking the user to first clean
the local changes or conflicts rather than silently resetting them.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix bash completion to not garble the screen with an error message.
Yann Dirson [Tue, 6 Mar 2007 20:18:44 +0000 (21:18 +0100)]
Fix bash completion to not garble the screen with an error message.

Maybe we could refuse to complete further when the command was not
recognized, but at least this fix avoids the annoying behaviour.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-sink: sink a patch to given location (mirrors float).
Yann Dirson [Fri, 2 Mar 2007 21:34:29 +0000 (21:34 +0000)]
Add contrib/stg-sink: sink a patch to given location (mirrors float).

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-mdiff: display diffs of diffs.
Yann Dirson [Fri, 2 Mar 2007 21:34:29 +0000 (21:34 +0000)]
Add contrib/stg-mdiff: display diffs of diffs.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-gitk: helper script to run gitk
Yann Dirson [Fri, 2 Mar 2007 21:34:29 +0000 (21:34 +0000)]
Add contrib/stg-gitk: helper script to run gitk

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-cvs: helper script to manage a mixed cvs/stgit working copy
Yann Dirson [Fri, 2 Mar 2007 21:34:28 +0000 (21:34 +0000)]
Add contrib/stg-cvs: helper script to manage a mixed cvs/stgit working copy

This is an early prototype only, use with care, and be sure to read the
LIMITATIONS section in the script comments.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-swallow: completely merge an unapplied patch into current one
Yann Dirson [Fri, 2 Mar 2007 21:34:28 +0000 (21:34 +0000)]
Add contrib/stg-swallow: completely merge an unapplied patch into current one

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-fold-files-from: pick selected changes from a patch above current one
Yann Dirson [Fri, 2 Mar 2007 21:34:28 +0000 (21:34 +0000)]
Add contrib/stg-fold-files-from: pick selected changes from a patch above current one

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-show-old: show old version of a patch.
Yann Dirson [Fri, 2 Mar 2007 21:34:28 +0000 (21:34 +0000)]
Add contrib/stg-show-old: show old version of a patch.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd contrib/stg-whatchanged: look at what would be changed by refreshing.
Yann Dirson [Fri, 2 Mar 2007 21:34:28 +0000 (21:34 +0000)]
Add contrib/stg-whatchanged: look at what would be changed by refreshing.

This script outputs a "metadiff" (diff of diffs, ie. diff between 2
versions of a single patch).  This is somewhat a proof of concept, and some
work is indeed needed in the way to present the results.  Consider
filtering the output at least through colordiff.

I have 2 uses for this script:
- when simply editing a patch, provides a 3rd way to check what I've done
  before refreshing (in addition to "stg diff" and "stg diff -r //bottom")
- most usefully, when resolving conflicts caused by a push, to ease
  checking of the merge result.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoUse and..or as a ternary operator rather than a dictionary
Catalin Marinas [Wed, 28 Feb 2007 11:10:22 +0000 (11:10 +0000)]
Use and..or as a ternary operator rather than a dictionary

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd EditorException to stgit/utils.py
Catalin Marinas [Wed, 28 Feb 2007 08:41:56 +0000 (08:41 +0000)]
Add EditorException to stgit/utils.py

The patch adds the stgit.main.main handling of this exception as well.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd an interractive 2-way merge option
Catalin Marinas [Wed, 28 Feb 2007 08:41:56 +0000 (08:41 +0000)]
Add an interractive 2-way merge option

Since emacs can handle 2-way merges as well with ediff-merge-files,
this patch changes the 'imerger' config option to 'i3merge' and also
adds an 'i2merge' option. The gitmergeonefile.py algorithm was
modified to handle 2-way merges interactively as well.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd missing files to stgit manifest.
Yann Dirson [Wed, 28 Feb 2007 08:41:56 +0000 (08:41 +0000)]
Add missing files to stgit manifest.

Many things, including Makefile and all documentation were left out of
various packaging because they're not included in the tarball.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMerge doc/ and Documentation/ directories.
Yann Dirson [Wed, 28 Feb 2007 08:41:55 +0000 (08:41 +0000)]
Merge doc/ and Documentation/ directories.

This merges everything into Documentation, to match the GIT layout
("make doc" did not work anyway since "doc" was not marked phony).

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd a Documentation directory inspired by the git one.
Yann Dirson [Wed, 28 Feb 2007 08:41:55 +0000 (08:41 +0000)]
Add a Documentation directory inspired by the git one.

The html and manpages are generated from asciidoc source.  Short
description strings are extracted from the python modules.

Only the stg(7) frontpage and the stg-new(1) command page are already
written.  A template is provided for new command pages.

This also reworks a couple of help strings and command classification.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFactorize editor handling.
Yann Dirson [Wed, 28 Feb 2007 08:41:55 +0000 (08:41 +0000)]
Factorize editor handling.

At the same time we trap the editor error for all editor calls, not
just when called from "stg mail".  We may want to define a new
exception for this though.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd a testcase for the safety of pull-policy='pull'.
Yann Dirson [Wed, 28 Feb 2007 08:41:42 +0000 (08:41 +0000)]
Add a testcase for the safety of pull-policy='pull'.

This testcase demonstrates a long-standing problem with the handling
of conflicts on a rewinding branch, when "stg pull" calls git-pull.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoCorrectly raise exception on unknown pull-policy.
Yann Dirson [Tue, 27 Feb 2007 22:39:09 +0000 (22:39 +0000)]
Correctly raise exception on unknown pull-policy.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd --branch option to 'patches'
Catalin Marinas [Fri, 23 Feb 2007 22:09:06 +0000 (22:09 +0000)]
Add --branch option to 'patches'

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoSome minor debian packaging fixes
Sam Vilain [Fri, 23 Feb 2007 22:09:06 +0000 (22:09 +0000)]
Some minor debian packaging fixes

17 years agoRework of the 'stg pull' policy.
Yann Dirson [Tue, 20 Feb 2007 23:16:11 +0000 (00:16 +0100)]
Rework of the 'stg pull' policy.

This patch changes the way "stg pull" behaviour is selected, by
replacing stgit.pull-does-rebase and stgit.pullcmd with
stgit.pull-policy, stgit.pullcmd and stgit.fetchcmd.  In the standard
case, only pull-policy needs to be set.

Those 3 config variables are also available per-branch as
branch.*.stgit.<name>.

This patch also add a set of tests for the fetch-rebase policy,
including interferences with "stg commit" occuring with 0.12.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoRefuse to pull/rebase when rendered unsafe by (un)commits.
Yann Dirson [Tue, 20 Feb 2007 00:14:24 +0000 (01:14 +0100)]
Refuse to pull/rebase when rendered unsafe by (un)commits.

This can be overriden by a new --force flag.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoKeep track of safe base changes.
Yann Dirson [Tue, 20 Feb 2007 00:14:19 +0000 (01:14 +0100)]
Keep track of safe base changes.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoVarious cleanups for clarity.
Yann Dirson [Tue, 20 Feb 2007 00:14:13 +0000 (01:14 +0100)]
Various cleanups for clarity.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoMove stack-base querying into Series class.
Yann Dirson [Tue, 20 Feb 2007 00:14:08 +0000 (01:14 +0100)]
Move stack-base querying into Series class.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFactorize rebasing behaviour.
Yann Dirson [Tue, 20 Feb 2007 00:14:03 +0000 (01:14 +0100)]
Factorize rebasing behaviour.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoSupport for pre-1.5 git in stgit tests.
Yann Dirson [Mon, 19 Feb 2007 22:22:54 +0000 (23:22 +0100)]
Support for pre-1.5 git in stgit tests.

Support for older Git versions was broken in
5cd9e87faa0a116ce2b378be6a5c89d5f20629f1 (post 0.12).

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoFix the mail command to parse longer address headers
Catalin Marinas [Wed, 21 Feb 2007 18:30:30 +0000 (18:30 +0000)]
Fix the mail command to parse longer address headers

If an address header is split over multiple lines, the old code was
only parsing the first line, missing the other addresses.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the alias check in the mail --bcc command
Catalin Marinas [Wed, 21 Feb 2007 18:30:30 +0000 (18:30 +0000)]
Fix the alias check in the mail --bcc command

A check for an empty alias was performed if autobcc wasn't set in the
config file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoDisplay whether the patch is empty after refresh
Catalin Marinas [Wed, 21 Feb 2007 18:30:30 +0000 (18:30 +0000)]
Display whether the patch is empty after refresh

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix import to allow --name and --strip for most import types
Catalin Marinas [Sat, 17 Feb 2007 23:57:39 +0000 (23:57 +0000)]
Fix import to allow --name and --strip for most import types

Originally, those options were only valid for a basic file import but
not for e-mail or url. This patch also replaces invalid characters in
the patch name with dashes.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoURL import for stgit
Clark Williams [Sat, 17 Feb 2007 20:42:27 +0000 (14:42 -0600)]
URL import for stgit

Signed-off-by: Clark Williams <clark.williams@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd --author option to series
Catalin Marinas [Fri, 16 Feb 2007 22:42:35 +0000 (22:42 +0000)]
Add --author option to series

This is similar to the --description option, only that the author name
is displayed instead.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAllow importing mbox files from stdin
Catalin Marinas [Fri, 16 Feb 2007 22:42:35 +0000 (22:42 +0000)]
Allow importing mbox files from stdin

The UnixMailbox does not support reading from stdin as it uses seek()
(at least on Python 2.3). This patch reads the stdin into a StringIO
object.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoFix the behaviour when there is no user information configured
Catalin Marinas [Tue, 13 Feb 2007 22:26:37 +0000 (22:26 +0000)]
Fix the behaviour when there is no user information configured

If there is no user.name or user.email set in the gitconfig files,
just use the defaults rather than failing.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoMake StGIT aware of the STGIT_DEBUG_LEVEL environment variable
Catalin Marinas [Tue, 13 Feb 2007 22:26:36 +0000 (22:26 +0000)]
Make StGIT aware of the STGIT_DEBUG_LEVEL environment variable

For now, setting this environment variable will make StGIT dump the
backtrace in case of a failure.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoUse canonical command name in help message.
Yann Dirson [Tue, 13 Feb 2007 22:26:36 +0000 (22:26 +0000)]
Use canonical command name in help message.

Let's expand shortcut command names in help messages, in all 3 forms
("help foo", "--help foo" and "foo --help").

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoAdd --merged option to rebase.
Yann Dirson [Tue, 13 Feb 2007 22:26:36 +0000 (22:26 +0000)]
Add --merged option to rebase.

Signed-off-by: Yann Dirson <ydirson@altern.org>
17 years agoRelease 0.12 v0.12
Catalin Marinas [Tue, 6 Feb 2007 22:48:03 +0000 (22:48 +0000)]
Release 0.12

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoAdd extra files to MANIFEST.in
Catalin Marinas [Tue, 6 Feb 2007 23:00:28 +0000 (23:00 +0000)]
Add extra files to MANIFEST.in

These are needed for building the rpm distribution.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
17 years agoEscape the quotes in example/gitconfig
Catalin Marinas [Tue, 6 Feb 2007 22:45:18 +0000 (22:45 +0000)]
Escape the quotes in example/gitconfig

With the new git-repo-config, the quotes are ignored unless escaped,
breaking some functionality (emacs interactive merger).

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