chiark / gitweb /
stgit
16 years agoMoved that status function to the status command file
David Kågedal [Fri, 14 Sep 2007 22:31:24 +0000 (00:31 +0200)]
Moved that status function to the status command file

The git.status() was more of a command than a library function, and
was only used in one place.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoClear up semantics of tree_status
David Kågedal [Fri, 14 Sep 2007 22:31:19 +0000 (00:31 +0200)]
Clear up semantics of tree_status

The tree_status() function does a few slightly different things
depending on the arguments.  This patch adds checks that the arguments
are consistent and that the returned value looks good.

It also changes the semantics slightly.  If the 'files' parameter is
None, it will run status on all files.  If 'files' is a list, it will
run status on only those files.  This changes two things:

 1) If 'files' is the empty list, it will run status on no files.
 2) It 'files' is a list, it will never return the status for other files

Clearing this up will make it easier to understand code that is using
this function.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd some more tests of "stg status" output
David Kågedal [Fri, 14 Sep 2007 22:31:14 +0000 (00:31 +0200)]
Add some more tests of "stg status" output

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNew test: make sure tha we can run "stg help"
Karl Hasselström [Sun, 23 Sep 2007 22:54:06 +0000 (00:54 +0200)]
New test: make sure tha we can run "stg help"

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoPrint 'updating patch' earlier in 'edit'
Catalin Marinas [Sat, 22 Sep 2007 22:38:30 +0000 (23:38 +0100)]
Print 'updating patch' earlier in 'edit'

Otherwise, the user waits without knowing what's going on.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd simple test for "stg branch --delete"
Karl Hasselström [Sat, 22 Sep 2007 08:23:37 +0000 (10:23 +0200)]
Add simple test for "stg branch --delete"

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoProperly remove all config for a deleted branch
Karl Hasselström [Sat, 22 Sep 2007 08:22:18 +0000 (10:22 +0200)]
Properly remove all config for a deleted branch

This uses "git-config --remove-section", which was first released in
git 1.5.1-rc1. I'm not sure if this is later than what we used to
depend on; we already use "git-config --rename-section", but that's
been in since git 1.5.0-rc0.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't try to delete the branch twice
Karl Hasselström [Sat, 22 Sep 2007 07:58:24 +0000 (09:58 +0200)]
Don't try to delete the branch twice

We already delete it in Stack.delete(), so don't do it here too.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't special-case the "master" branch during branch delete
Karl Hasselström [Sat, 22 Sep 2007 07:54:25 +0000 (09:54 +0200)]
Don't special-case the "master" branch during branch delete

It's unintuitive, unsymmetric and doesn't work if there is no
"master". Instead, prohibit deletion of the current branch.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoIt doesn't make sense to sink below an unapplied patch
Karl Hasselström [Thu, 13 Sep 2007 22:49:43 +0000 (00:49 +0200)]
It doesn't make sense to sink below an unapplied patch

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd 'edit' to the patchcommands list
Catalin Marinas [Fri, 14 Sep 2007 17:58:16 +0000 (18:58 +0100)]
Add 'edit' to the patchcommands list

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd patch editing command
Catalin Marinas [Fri, 14 Sep 2007 17:51:57 +0000 (18:51 +0100)]
Add patch editing command

This patch adds the 'edit' command which takes most of the similar
functionality out of 'refresh'. In addition, it allows the direct
patch diff editing with the '--diff' option. The patch/e-mail parsing
functions were moved from stgit.commands.imprt to
stgit.commands.common as they are now used by both 'import' and
'edit'.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoInclude summary of added/deleted files in diffstat
Karl Hasselström [Tue, 11 Sep 2007 03:57:14 +0000 (05:57 +0200)]
Include summary of added/deleted files in diffstat

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd shortlog of patch series to cover mail
Karl Hasselström [Tue, 11 Sep 2007 03:57:14 +0000 (05:57 +0200)]
Add shortlog of patch series to cover mail

Unlike the cover mail diffstat, this covers exactly the selected
patches and nothing else.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd diffstat of whole patch series to cover mail
Karl Hasselström [Tue, 11 Sep 2007 03:57:14 +0000 (05:57 +0200)]
Add diffstat of whole patch series to cover mail

Note: The diffstat is computed from the bottom of the first patch to
the top of the last, which gives a correct result if and only if the
series is contiguous. This is often the case, and handling anything
but this case is nontrivial, as it would involve creating a temporary
series of commits that are contiguous, with all the performance and
merge problems that would entail.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSet GIT_TEMPLATE_DIR in the testsuite, like it's done in git
Pavel Roskin [Mon, 10 Sep 2007 02:48:15 +0000 (22:48 -0400)]
Set GIT_TEMPLATE_DIR in the testsuite, like it's done in git

Otherwise, the git configuration affects the testsuite.  Since we don't
have git templates in the source tree, use our "template" directory.
No templates are really needed, it's just a directory with known
contents.

Remove the command that moves .git/hooks away, as it's not created
anymore.  Create empty .git/info/, as some tests assume it to exist.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd --sign and --ack options to "stg import"
Karl Hasselström [Tue, 11 Sep 2007 03:57:14 +0000 (05:57 +0200)]
Add --sign and --ack options to "stg import"

Do this by factoring out the handling of these options from "stg
refresh".

Also, don't add sign lines that are already present.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd the any() and all() utility functions from Python 2.5
Karl Hasselström [Tue, 11 Sep 2007 01:34:08 +0000 (03:34 +0200)]
Add the any() and all() utility functions from Python 2.5

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDiscard stderr when determining if a patch is already applied
Karl Hasselström [Thu, 6 Sep 2007 23:31:22 +0000 (01:31 +0200)]
Discard stderr when determining if a patch is already applied

An error from git-apply just means that the patch isn't applied.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agogit.__remotes_from_dir() should only return lists
Pavel Roskin [Wed, 5 Sep 2007 16:57:22 +0000 (12:57 -0400)]
git.__remotes_from_dir() should only return lists

If there are no remotes, return empty list, not None.  The later doesn't
work with builtin set().

This fixes t1001-branch-rename.sh

Signed-off-by: Pavel Roskin <proski@gnu.org>
16 years agoUse the builtin set() instead of sets.Set()
Karl Hasselström [Mon, 3 Sep 2007 21:48:51 +0000 (23:48 +0200)]
Use the builtin set() instead of sets.Set()

We can do that now that we're guaranteed to have Python 2.4 or later.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUse subprocess.Popen to call git executables
Karl Hasselström [Mon, 3 Sep 2007 21:48:45 +0000 (23:48 +0200)]
Use subprocess.Popen to call git executables

Replace popen2.Popen3 and os.spawn* with the superior
subprocess.Popen. Now we can pass a modified environment to any
subprocess, redirect input and output as we please, and the shell is
no longer involved, meaning we don't have to worry about argument
quoting. (We could already do all of that, just not at the same time.)

This is a Python 2.4 library, so StGit now officially requires Python
2.4 or later.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTest "stg status" more thoroughly
Karl Hasselström [Sun, 2 Sep 2007 22:07:13 +0000 (00:07 +0200)]
Test "stg status" more thoroughly

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAllow "stg add" when we have no stack
Karl Hasselström [Sun, 2 Sep 2007 22:06:16 +0000 (00:06 +0200)]
Allow "stg add" when we have no stack

There's simply no reason not to allow this. It behaves just like
git-add, so it's well-defined enough.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet "stg status" ignore empty directories
Karl Hasselström [Fri, 31 Aug 2007 19:41:54 +0000 (21:41 +0200)]
Let "stg status" ignore empty directories

This was a really simple fix: just pass the right flag to
git-ls-files. Since the output has a trailing \0, split() gives us an
empty string at the end of the list that we have to throw away.
(Curiously, there was an empty string at the end before this change
too, but it disappeared somehow.)

This fixes bug 9891.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoFix refresh -es
Pavel Roskin [Fri, 31 Aug 2007 03:04:55 +0000 (23:04 -0400)]
Fix refresh -es

Use named arguments to call git.diff() from stack.edit_file().
git.diff() doesn't write to files anymore, do it in the caller.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUse --force to overwrite python files
Pavel Roskin [Fri, 31 Aug 2007 03:04:49 +0000 (23:04 -0400)]
Use --force to overwrite python files

Installing StGIT with "make install" is not working properly if another
version is installed.  Files under ~/lib/python2.5/site-packages/stgit
are not updated.

This causes unexpected problems if switching between different branches
of StGIT.

Using "--force" ensures that the files in the tree are installed even if
the already installed files are newer.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't fail just because a subprocess wrote stuff to stderr
Karl Hasselström [Wed, 29 Aug 2007 12:24:15 +0000 (14:24 +0200)]
Don't fail just because a subprocess wrote stuff to stderr

Instead, pass the message on to the user and assume the subprocess was
successful. We need to do this since some git commands print warnings
on stderr even though they succeed.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoWrite warnings and errors to stderr if not on a terminal
Karl Hasselström [Wed, 29 Aug 2007 12:22:27 +0000 (14:22 +0200)]
Write warnings and errors to stderr if not on a terminal

Otherwise, they are suppressed along with the rest of the output. But
if stdout is a terminal, so that output is not suppressed, write
errors through the same Output object as info messages to get the
indentation etc. right.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoCleanup tree_status and use -z
David Kågedal [Fri, 17 Aug 2007 15:06:33 +0000 (17:06 +0200)]
Cleanup tree_status and use -z

Improved the python code, eliminating temporary variables and using
destructuring binds. And use NUL-separation instead of newlines.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd basic test for stg status
David Kågedal [Thu, 30 Aug 2007 11:00:58 +0000 (13:00 +0200)]
Add basic test for stg status

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd the '--exclusive' option to 'uncommit'
Catalin Marinas [Wed, 29 Aug 2007 10:52:59 +0000 (11:52 +0100)]
Add the '--exclusive' option to 'uncommit'

This option makes the commits range given by the --to option
exclusive, i.e. the last commit is not uncomitted.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoMake the maximum patch name length configurable
Catalin Marinas [Wed, 29 Aug 2007 10:52:59 +0000 (11:52 +0100)]
Make the maximum patch name length configurable

The config variable is stgit.namelenth

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd optional logging of subprocess execution
Karl Hasselström [Sun, 26 Aug 2007 20:04:10 +0000 (22:04 +0200)]
Add optional logging of subprocess execution

Now that the subprocess calling has been refactored and is in a nice
shape, it's quite simple to add some logging facilities. This patch
adds two separate log modes, switched by the STG_SUBPROCESS_LOG
environment variable:

  * Setting it to "debug" prints the executable name and all
    arguments, and the subprocess return value.

  * Setting it to "profile" prints just the executable name, and the
    (wallclock) time elapsed during the call.

  * Not setting it will disable logging, of course.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAssert that the argument to Run is a sequence of strings
Karl Hasselström [Fri, 24 Aug 2007 11:26:01 +0000 (13:26 +0200)]
Assert that the argument to Run is a sequence of strings

This runtime assertion makes bugs easier to find.

In most other languages, we'd have been able to check this at compile
time. But this is Python. Yay!

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRefactor subprocess creation
Karl Hasselström [Tue, 21 Aug 2007 16:15:38 +0000 (18:15 +0200)]
Refactor subprocess creation

Instead of having a gazillion different little functions that wrap
os.spawnvp and popen2.Popen3, make a single wrapper that's flexible
enough to cater to everyone. Apart from making the code cleaner and
easier to read, this has the added benefit of making it possible to
add little things such as extra safety checks and logging.

Ideally, I'd have liked this wrapper to wrap subprocess.Popen, but
that's only available in Python 2.4 and up, so we'll have to make do
with os.spawnvp and popen2.Popen3 for now, even though they suck.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRefactor output handling to break circular dependency
Karl Hasselström [Sun, 26 Aug 2007 20:04:10 +0000 (22:04 +0200)]
Refactor output handling to break circular dependency

I ran into problems when trying to use the fancy output handling in a
new module that was (recursively) imported by stgit.util -- I couldn't
use the out object because it wasn't defined yet.

Break out the output handler to its own module to break the circular
dependency.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoCompile regexp just once
Karl Hasselström [Sat, 25 Aug 2007 18:10:38 +0000 (20:10 +0200)]
Compile regexp just once

It's a waste of time to recompile the same regexp every time we go
through the loop.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoReplace "git repo-config" with "git config" in help texts
Karl Hasselström [Sat, 25 Aug 2007 18:02:09 +0000 (20:02 +0200)]
Replace "git repo-config" with "git config" in help texts

It makes sense to still use git-repo-config instead of git-config in
the code, since the latter name is not available in older gits, but
it's better to use the new name in the help texts since the
overwhelming majority of users aren't going to use a very old git.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't write None to the conf file
Karl Hasselström [Fri, 24 Aug 2007 11:20:17 +0000 (13:20 +0200)]
Don't write None to the conf file

If we don't have a value for the remote, just don't write it. Writing
None will either write the string "None" or crash StGIT, depending on
how exactly the call is done -- and neither is what we want!

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't use test_expect_failure when more than one thing could fail
Karl Hasselström [Fri, 24 Aug 2007 09:49:24 +0000 (11:49 +0200)]
Don't use test_expect_failure when more than one thing could fail

It's much better to use ! for the part that you actually expect to
fail; that way, the test will still scream if something _else_ goes
wrong.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAllow 'import' to apply empty patches
Catalin Marinas [Thu, 23 Aug 2007 16:45:27 +0000 (17:45 +0100)]
Allow 'import' to apply empty patches

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoFixed indeterminism in t2102-pull-policy-rebase
David Kågedal [Thu, 23 Aug 2007 16:45:26 +0000 (17:45 +0100)]
Fixed indeterminism in t2102-pull-policy-rebase

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't touch ref files manually
Karl Hasselström [Thu, 23 Aug 2007 16:45:26 +0000 (17:45 +0100)]
Don't touch ref files manually

Messing with files manually doesn't work if the refs are packed. The
officially preferred way is to use git-update-ref, git-show-ref,
et.al. So do that.

As a consequence of this, we have some small behavior changes:

  * We used to not leave empty directories behind in the refs tree.
    But now that's all in the hands of git-update-ref, which does
    leave them behind. Tests that assumed the old behavior have been
    fixed.

  * We (that is, git-show-ref) no longer distinguish between a ref
    that doesn't exist and a ref that contains garbage. So the tests
    that assumed we'd fail when encountering a spurious ref with
    garbage in it have had to go through attitude readjustment.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoInclude contrib scripts in the release tarball.
Yann Dirson [Sun, 29 Jul 2007 13:32:10 +0000 (15:32 +0200)]
Include contrib scripts in the release tarball.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake use of the get_patch() utility function
Karl Hasselström [Fri, 25 May 2007 00:25:38 +0000 (02:25 +0200)]
Make use of the get_patch() utility function

We already had it, but no one was using it

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't print unnecessary backtraces when testing
David Kågedal [Fri, 17 Aug 2007 11:36:51 +0000 (13:36 +0200)]
Don't print unnecessary backtraces when testing

When stg fails, and handles it properly, no backtrace should be printed,
even when running tests with -v.  Getting a backtrace in the output signals
some kind of bug, but in this case there is no bug.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNew test: make sure that StGIT can handle packed refs
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
New test: make sure that StGIT can  handle packed refs

It currently can't, which is why this test is needed. The situation
has recently taken a turn for the worse, since git-gc nowadays packs
refs by default.

16 years agoRename all config sections of a branch
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Rename all config sections of a branch

Just renaming the branch.branchname section doesn't rename the
branch.branchname.stgit section -- we have to do that explicitly.

This fixes bug 9692.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTest that all branch config information is renamed
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Test that all branch config information is renamed

This test currently fails (which is precisely why it's needed, of
course.) This is bug 9692 in the bug tracker.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd an --smtp-server commandline option to "stg mail"
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Add an --smtp-server commandline option to "stg mail"

The configuration option stgit.smtpserver is useful if you always talk
to the same SMTP server. But I usually set up a temporary ssh tunnel,
so I'd rather have a commandline option.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoVerify patch status during the test
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Verify patch status during the test

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNew test: make sure that popping doesn't change patch order
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
New test: make sure that popping doesn't change patch order

This is mostly useful in conjunction with the DAG appliedness patches,
since getting this right with a plain series file _ought_ to be
trivial. Nevertheless ...

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTeach StGIT about core.excludesfile
Karl Hasselström [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Teach StGIT about core.excludesfile

If there is a core.excludesfile option specified, let StGIT take
exclude patterns from that file, since that's what the docs say, and
what everyone else is already doing.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAsk for SMTP password if it's not provided
Pavel Roskin [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Ask for SMTP password if it's not provided

Mention this in examples/gitconfig, explain SMTP options in more detail.

Signed-off-by: Pavel Roskin <proski@gnu.org>
16 years agoAdd support for SMTP over Transport Layer Security (TLS)
Pavel Roskin [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Add support for SMTP over Transport Layer Security (TLS)

Signed-off-by: Pavel Roskin <proski@gnu.org>
16 years agoFixed completion function hardcoding .git/.
Yann Dirson [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Fixed completion function hardcoding .git/.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoProvide file completion for add/resolved/refresh based on status.
Yann Dirson [Mon, 20 Aug 2007 21:36:00 +0000 (22:36 +0100)]
Provide file completion for add/resolved/refresh based on status.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd a no-act flag to stg-dispatch and stg-fold-file-from.
Yann Dirson [Mon, 20 Aug 2007 21:35:59 +0000 (22:35 +0100)]
Add a no-act flag to stg-dispatch and stg-fold-file-from.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd -O flag to stg-fold-files-from.
Yann Dirson [Mon, 20 Aug 2007 21:35:59 +0000 (22:35 +0100)]
Add -O flag to stg-fold-files-from.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoNew contrib scripts: stg-dispatch and stg-show.
Yann Dirson [Mon, 20 Aug 2007 21:35:59 +0000 (22:35 +0100)]
New contrib scripts: stg-dispatch and stg-show.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoImprove stg-fold-files-from doc.
Yann Dirson [Mon, 20 Aug 2007 21:35:59 +0000 (22:35 +0100)]
Improve stg-fold-files-from doc.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoRelease 0.13 v0.13
Catalin Marinas [Wed, 25 Jul 2007 23:03:27 +0000 (00:03 +0100)]
Release 0.13

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd .mailmap file
Catalin Marinas [Wed, 25 Jul 2007 23:00:18 +0000 (00:00 +0100)]
Add .mailmap file

This is to correct various misspelled names.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoPort stg-whatchanged improvements to stg-mdiff and have the former use the latter.
Yann Dirson [Tue, 24 Jul 2007 18:57:46 +0000 (20:57 +0200)]
Port stg-whatchanged improvements to stg-mdiff and have the former use the latter.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd to stg-mdiff the ability to pass options to underlying diff opts.
Yann Dirson [Tue, 24 Jul 2007 18:57:41 +0000 (20:57 +0200)]
Add to stg-mdiff the ability to pass options to underlying diff opts.

So we now have -O, similar to the existing option in stg diff, to pass
flags to git-diff when computing the 2 diffs to compare (-M, -C and -w
come to mind as being potentially useful here), and -o can be used to
tune the invocation of diff on those 2 diffs.

Note that -o is only there temporarily, and will disappear when a more
sophisticated process than plain diff will be used.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd range comparison support to stg-mdiff.
Yann Dirson [Tue, 24 Jul 2007 18:57:35 +0000 (20:57 +0200)]
Add range comparison support to stg-mdiff.

We can now compare arbitrary deltas, not just single commits.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoFix stg-whatchanged to deal with conflicts already solved.
Yann Dirson [Tue, 24 Jul 2007 18:57:30 +0000 (20:57 +0200)]
Fix stg-whatchanged to deal with conflicts already solved.

The most reliable way I found to decide if we were in the process of
solving a conflict, including when all conflicted files have already
been marked resolved, is to check the latest patchlog entry.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoModify the assertion in Series.new_patch
Catalin Marinas [Tue, 17 Jul 2007 23:01:22 +0000 (00:01 +0100)]
Modify the assertion in Series.new_patch

The bottom == head assertion is wrong when the patch is created as
unapplied.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAllow refresh --annotate to replace the top log entry
Catalin Marinas [Tue, 17 Jul 2007 23:01:21 +0000 (00:01 +0100)]
Allow refresh --annotate to replace the top log entry

If there is no changes to check in and therefore no patch commit to
generate, the --annotate option simply replaces the top log with one
containing the notes.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd the '--expose' option to 'pick'
Catalin Marinas [Mon, 16 Jul 2007 22:48:31 +0000 (23:48 +0100)]
Add the '--expose' option to 'pick'

This option is similar to the '-x' one of the git-cherry-pick
command (maybe the naming is not really obvious). It appends the
imported commit id to the patch log.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoDo not call 'refresh' when creating a patch (bug #8872)
Catalin Marinas [Mon, 16 Jul 2007 22:48:30 +0000 (23:48 +0100)]
Do not call 'refresh' when creating a patch (bug #8872)

The Series.new_patch function was calling refresh_patch which led to
checking in the pending adds in the index. This patch adds the
creation of a commit without writing the index.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAllow 'refresh' to annotate the patch log entries
Catalin Marinas [Mon, 16 Jul 2007 22:48:30 +0000 (23:48 +0100)]
Allow 'refresh' to annotate the patch log entries

With the '--annotate' option, the patch log entry generated by refresh
can contain an additional message. The patch also removes the '-a'
shortcut for '--author' and adds it to '--annotate' (the latter would
be used more often).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoDisplay a message when the server refused some recipients.
Yann Dirson [Mon, 16 Jul 2007 22:48:30 +0000 (23:48 +0100)]
Display a message when the server refused some recipients.

When the smtp server directly refuses some recipients, an exception is
only raised when no recipient got the parcel.  This patch displays the
recipients which were denied.

Subsequent delivery is still done, no change here.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoRevert 'Disallow non-patch args to "stg show" (gna #8453).'
Yann Dirson [Mon, 16 Jul 2007 22:48:29 +0000 (23:48 +0100)]
Revert 'Disallow non-patch args to "stg show" (gna #8453).'

This patch has a lot of side-effects that will break people's
expectations.  There is much more that just this to do if we want to
sanitize patch/commit/range addressing on the command-line, so that
will wait till after 0.13.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd a constructor to PatchSet.
Yann Dirson [Fri, 13 Jul 2007 22:43:57 +0000 (23:43 +0100)]
Add a constructor to PatchSet.

Move __base_dir up into PatchSet as well, and add an accessor.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoDocument shortcoming of stg-k and stg-unnew.
Yann Dirson [Fri, 13 Jul 2007 22:43:56 +0000 (23:43 +0100)]
Document shortcoming of stg-k and stg-unnew.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoRecognize refs under remotes/ as parent branch on stack creation.
Yann Dirson [Fri, 13 Jul 2007 22:43:56 +0000 (23:43 +0100)]
Recognize refs under remotes/ as parent branch on stack creation.

Also remove the "relaxed" parentbranch detecting logic (accepting
anything with an embedded slash as a parent branch name), which was
never invoked because of a bug, and looks like a bad idea anyway.
Better add sensible namespaces when we feel a need for them, rather
than accepting anything by default, with potentially unwanted results.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoForbid the "series --all --short" combination.
Yann Dirson [Fri, 13 Jul 2007 22:43:56 +0000 (23:43 +0100)]
Forbid the "series --all --short" combination.

That combination would otherwise simply augment with hidden patches
the display we would have with --short, which does not seem useful,
but can be confusing.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoMake hidden patches visible to various commands (notably log, show, pick).
Yann Dirson [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Make hidden patches visible to various commands (notably log, show, pick).

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoDisallow non-patch args to "stg show" (gna #8453).
Yann Dirson [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Disallow non-patch args to "stg show" (gna #8453).

Git-core refs and patch@branch args were not allowed in the
multiple-argument form of "stg show".  For consistency we completely
disallow them: git-core refs are available from git-show, and "stg
show patch@branch" as "stg show patch -b branch".

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAllow "git show --branch".
Yann Dirson [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Allow "git show --branch".

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoAdd --keep option to goto
Catalin Marinas [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Add --keep option to goto

This option is similar to the one for the pop command.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd '--update' option to 'refresh'
Catalin Marinas [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Add '--update' option to 'refresh'

This option is similar to the one from 'pick'. It only updates the
files already part of the current patch.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd the --unrelated option to mail
Catalin Marinas [Fri, 13 Jul 2007 22:43:55 +0000 (23:43 +0100)]
Add the --unrelated option to mail

This option allows the unrelated patches to be sent without sequence
numbering and as replies to the top one.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years ago'sync' code comments clean-up after commit 6b79a09c
Catalin Marinas [Fri, 13 Jul 2007 22:43:54 +0000 (23:43 +0100)]
'sync' code comments clean-up after commit 6b79a09c

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoIf available, use gitk --argscmd in contrib/stg-gitk.
Yann Dirson [Mon, 25 Jun 2007 21:24:56 +0000 (23:24 +0200)]
If available, use gitk --argscmd in contrib/stg-gitk.

This allows to ask gitk to recompute the list of patches to show at
every refresh.  Before this, we had problems with 'stg-gitk --all':

 - deleting a patch that was existing at startup time would trigger an
 "unknown ref" error from gitk and force to quit/restart manually;
 - patches created since startup were only visible when applied, or
 when below one of the startup patches.

Note that --argscmd is not in official gitk yet, so we don't try to
use it if it's not available.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoFix t1200 to catch intermediate errors.
Yann Dirson [Mon, 25 Jun 2007 21:24:51 +0000 (23:24 +0200)]
Fix t1200 to catch intermediate errors.

All command sequences in tests should be linked with && or
similar, to guard against potentially missing a regresssion.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoChanged sync not to use -b which has other semantics.
Yann Dirson [Mon, 25 Jun 2007 21:24:46 +0000 (23:24 +0200)]
Changed sync not to use -b which has other semantics.

Using --branch here is confusing from a UI point of view, and
unnecessarily complicates implementation, making it more delicate to
get rid of the crt-series global.  We now use --ref-branch (-B)
instead.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoFixed thinko in error message.
Yann Dirson [Mon, 25 Jun 2007 21:24:41 +0000 (23:24 +0200)]
Fixed thinko in error message.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoRevert part of the reverted commit that we want to keep.
Yann Dirson [Mon, 25 Jun 2007 21:24:36 +0000 (23:24 +0200)]
Revert part of the reverted commit that we want to keep.

- get rid of unused real_rebase parameter
- revive git.all_refs()

This commit can freely be used to demonstrate the usefulness of
_always_ separating different issues in different patches :)

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agostg-cvs: update doc, and use correct setting for parent branch.
Yann Dirson [Mon, 25 Jun 2007 21:24:31 +0000 (23:24 +0200)]
stg-cvs: update doc, and use correct setting for parent branch.

This script had not been updated when we moved away from my wrong
interpretation of branch.*.merge.

At the same time, this includes some doc to set up a branch for use
with this command, and propotes design flaws to such, instead of
leaving them hidden among mere limitation of the implementation.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoFix contrib/stg-whatchanged way of identifying a conflict.
Yann Dirson [Mon, 25 Jun 2007 21:24:26 +0000 (23:24 +0200)]
Fix contrib/stg-whatchanged way of identifying a conflict.

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoFix the importing of multipart emails
Catalin Marinas [Fri, 22 Jun 2007 21:21:56 +0000 (22:21 +0100)]
Fix the importing of multipart emails

The old version was assuming that there are only two parts - the
description and the diff. However, it was failing for PGP-signed or
other multipart encoded emails. This patch generates a full text from
all the text/plain parts and parses it afterwards for description and
diff. This solves the combination of inline or attached patches
together with PGP-signed messages.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoModify the 'patches' command to use the locally modified files
Catalin Marinas [Fri, 22 Jun 2007 21:21:55 +0000 (22:21 +0100)]
Modify the 'patches' command to use the locally modified files

With this patch, when running 'stg patches' without any arguments, it
uses the locally modified files by default. This way one can see which
patches are affected by the locally modified files.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoPass a string rather than an exception object in gitmergeonefile
Catalin Marinas [Thu, 21 Jun 2007 22:04:49 +0000 (23:04 +0100)]
Pass a string rather than an exception object in gitmergeonefile

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoUpdate test-lib.sh from current git.
Yann Dirson [Thu, 14 Jun 2007 21:15:27 +0000 (23:15 +0200)]
Update test-lib.sh from current git.

Updated with changes to git up to rev
664368886781b7c070233c002597b84628eec571, including:

* GIT_SKIP_TESTS support, useful to run the testsuite bypassing tests
known to fail
* test_tick utility function to forge realistic commit dates
* deprecation of git-init-db in favor of git-init
* more environment safety cleanups

Signed-off-by: Yann Dirson <ydirson@altern.org>
16 years agoRevert 'Changed rebasing safety check to look for reachability of
Yann Dirson [Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)]
Revert 'Changed rebasing safety check to look for reachability of
stack base (gna bug #9181).'

This patch is reverting commit
bd69feaf7c3c94b6e7e216ea8091064af9cdfa97 (patch not yet ready for the
master branch).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoRevert 'Test "stg rebase" after "stg commit"'
Yann Dirson [Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)]
Revert 'Test "stg rebase" after "stg commit"'

This patch is reverting commit
a02ba4077f12578fe31c99d903488804a656e1c4 (author Karl but assigned to
Yann in error).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoShow a joined string rather than list when reporting GIT failures
Catalin Marinas [Tue, 12 Jun 2007 21:57:08 +0000 (22:57 +0100)]
Show a joined string rather than list when reporting GIT failures

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