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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Rename branch.*.stgitformatversion to branch.*.stgit.stackformatversion.
Nearly as discussed on the ml, with the name slightly modified to
better allow other types of PatchSet.
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Move stack format-version checks into Stack class.
This defines an interface which is called from PatchSet, and can
(must) be implemented in classes inheriting PatchSet.
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Abstract a PatchSet object out of Series.
The goal is to move into PatchSet all functionnality that is not
dependant of Series being a real stack, paving the way for handling
parallel (hydra) stacks, or any other way to organize patches.
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Use get/set_name for a stack's name.
It is much more clear to use get_name() than get_branch(), and this is
a step towards factoring stuff into a PatchSet class.
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Have mail take the default for --prefix from stgit.mail.prefix.
It is more convenient to set the prefix once and for all in the config
file than each time on command line.
Yann Dirson [Tue, 12 Jun 2007 21:57:07 +0000 (22:57 +0100)]
Have series show empty hidden patches as hidden rather than empty.
It is probably more important to show the hidden status of an empty
patch, since "clean" will not delete it anyway, and the display would
be ambiguous for a patch tagged "0" just before a patch tagged "!".
Yann Dirson [Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)]
Test "stg rebase" after "stg commit"
Two new tests for "stg rebase":
1. Try to rebase to a commit that is ahead of HEAD. This should
work, and does.
2. Try to commit a patch, and then rebase. This doesn't work,
because "stg rebase" aborts if orig-base != base, and "stg
commit" doesn't update orig-base. (It does work if "stg rebase"
is given the --force flag.)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
Yann Dirson [Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)]
Changed rebasing safety check to look for reachability of stack base (gna bug #9181).
Signed-off-by: Yann Dirson <ydirson@altern.org>
Catalin Marinas [Fri, 8 Jun 2007 22:46:11 +0000 (23:46 +0100)]
Add my release scripts to the contrib directory
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Fri, 8 Jun 2007 22:18:04 +0000 (23:18 +0100)]
Factor out common functionality into the utils.py file
Sequences for writing or reading lists to/from files are moved to the
stgit.utils file.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Fri, 8 Jun 2007 22:13:34 +0000 (23:13 +0100)]
Fix the hidden patches functionality (bug #9077)
This patch fixes the misleading functionality of hiding/unhiding
patches. Only unapplied patches can be hidden and they are now on a
separate list. Commands like 'stg push --all' will not push hidden
patches.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Catalin Marinas [Thu, 7 Jun 2007 22:13:57 +0000 (23:13 +0100)]
Fix bug #9284 - error messages include abbreviated command
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Yann Dirson [Wed, 6 Jun 2007 22:01:52 +0000 (00:01 +0200)]
Fixed typo in contrib/stg-whatchanged.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Wed, 6 Jun 2007 22:01:47 +0000 (00:01 +0200)]
Catch early trying rebasing to unknown ref, and add testcase.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Wed, 6 Jun 2007 22:01:42 +0000 (00:01 +0200)]
Robustify rebase test: check patches are reapplied.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Wed, 6 Jun 2007 21:05:22 +0000 (23:05 +0200)]
Fix removal of series to nuke the formatversion config item.
Since this parameter is now used to decide if the branch has already
been initialised, not removing it forbids to create a stack with the
same name as one that was deleted.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Wed, 6 Jun 2007 21:05:17 +0000 (23:05 +0200)]
Fix removal of series with non-existant trash dir.
Otherwise it is not possible to delete a stack that never had a patch
deleted (eg. a newborn stack).
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Mon, 4 Jun 2007 21:14:43 +0000 (23:14 +0200)]
Fix deletion and move of a hidden patch (gna bug #9244).
We must unhide a patch before we delete it, or we get an exception
while trying to unhide a non-existent patch.
Similarly, when renaming a hidden patch, we must take care of hiding
an unhiding at the right moment.
Both problems introduced in commit
841c7b2a6b015e3ab3331713cf10caf7a4fd0b49 when first indroducing patch
hiding.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Thu, 31 May 2007 22:34:38 +0000 (00:34 +0200)]
Add new --diff-opts/-O flag to diff- and status-related commands.
This new flag allows to pass arbitrary flags to the git-diff calls
underlying several StGIT commands. It can be used to pass flags
affecting both diff- and status-generating commands (eg. -M or -C), or
flags only affecting diff-generating ones (eg. --color, --binary).
It supercedes --binary for commands where it was allowed,
'-O --binary' is now available for the same functionality.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Thu, 31 May 2007 22:34:33 +0000 (00:34 +0200)]
Make diff flags handling more modular.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Thu, 31 May 2007 22:34:28 +0000 (00:34 +0200)]
Call external commands without a shell where possible.
On my dev box it consistently improves performance when timing the
full testsuite:
before:
user 2m22.509s
sys 0m50.695s
user 2m23.565s
sys 0m49.399s
user 2m23.497s
sys 0m49.675s
after:
user 2m20.261s
sys 0m45.687s
user 2m21.485s
sys 0m46.427s
user 2m20.581s
sys 0m45.367s
Signed-off-by: Yann Dirson <ydirson@altern.org>
Yann Dirson [Thu, 31 May 2007 22:34:23 +0000 (00:34 +0200)]
Add 2 new contrib scripts.
Signed-off-by: Yann Dirson <ydirson@altern.org>
Catalin Marinas [Tue, 22 May 2007 20:45:53 +0000 (21:45 +0100)]
Fix the automatic patch name generation for the pick command
It was broken by a recent commit to unify the patch name generation.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Petr Baudis [Tue, 22 May 2007 20:45:53 +0000 (21:45 +0100)]
StGIT: Support Cc: fields in stg mail --auto
Aside of Signed-off-by and Acked-by fields, Cc fields may occur in the
message footer; include them in the auto-composed mail Cc list.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Catalin Marinas [Mon, 21 May 2007 20:58:39 +0000 (21:58 +0100)]
Add a "make tags" target
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Robin Rosenberg [Mon, 21 May 2007 20:58:39 +0000 (21:58 +0100)]
Don't use / as separatar since it is common i branch names
Don't use / as separatar since it is common i branch names
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Robin Rosenberg [Mon, 21 May 2007 20:58:39 +0000 (21:58 +0100)]
Update the bash prompt from 'applied' instead of the obsolete 'current'
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
söndag 20 maj 2007 skrev Yann Dirson:
> Note that "tail -1" gives a warning with newer versions, "tail -n 1"
> should be the proper call.
My man page doesn't mention -N being deprecated, but ok since -n 1 seems
to work here too.
> Also I'm not sure it is a good way to look at "applied" file, since
> Karl IIRC has plans to change this. Better call "stg top" and not
> touch that again :)
Calling stg is too slow to be be used here. I that command in my first draft
for this function and people complained (see the thread named "Bash snippet
to show branch and patch in bash prompt"). It takes ~ 0.15s on here which is
very noticable, barely below my pain threshold.
We'll update the prompt when and if Karl breaks this.
It'd probably drain my battery too :/
-- robin
contrib/stgbashprompt.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Karl Hasselström [Mon, 21 May 2007 20:58:39 +0000 (21:58 +0100)]
Refactor message printing
Feed all those little progress and status messages through a central
place where such things as newlines, indentation, and suppressing
output when not on a TTY can be taken care of once and for all.
This patch takes care of almost, but not quite, all output. The most
notable leftover is the printing of help messages.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 21 May 2007 20:58:38 +0000 (21:58 +0100)]
Add --binary flag to commands that generate diffs
This just passes the --binary option to git-diff-*, which causes the
generated diffs to contain an applyable diff even when binary files
differ. It's necessary to do this if you want to mail patches to
binary files.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 21 May 2007 20:58:38 +0000 (21:58 +0100)]
Test the format version upgrade code
This test contains tarballs of repositories created with older
versions of StGIT. It also contains the script used to generate them,
but at some point we will lose the ability to easily run old versions
-- for example, if git changes incompatibly -- so tarballs will be the
only practical option for sufficiently old versions.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 21 May 2007 20:58:38 +0000 (21:58 +0100)]
Upgrade old StGIT branches to new-format metadata
There used to be a "stg branch --convert" command that switched
between "old" and "new" format metadata. But my recent metadata
cleanup patches introduced a "new new" format, and more are hopefully
on the way, so it was time to start versioning the metadata format
explicitly in order to avoid future headaches.
This patch removes the "stg branch --convert" command, and makes StGIT
automatically upgrade older formats to the latest format. It stores
the format (as an integer) in the config file. The current metadata
format version number is 2 (the "old" format is 0, and the "new"
format is 1).
Signed-off-by: Karl Hasselström <kha@treskal.com>
Karl Hasselström [Mon, 21 May 2007 20:58:38 +0000 (21:58 +0100)]
Have only a single command in each test_expect_failure
Otherwise, we can't know which one failed.
Signed-off-by: Karl Hasselström <kha@treskal.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>