stgit
16 years agoReduce number of backslashes by using raw strings
Karl Hasselström [Tue, 5 Feb 2008 05:51:30 +0000 (06:51 +0100)]
Reduce number of backslashes by using raw strings

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake documentation less confusing
Karl Hasselström [Mon, 4 Feb 2008 18:57:42 +0000 (19:57 +0100)]
Make documentation less confusing

It's not just by default "stg new" doesn't do a refresh -- it never
does.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't check out files if we don't have index+workdir
Karl Hasselström [Sun, 10 Feb 2008 14:43:41 +0000 (15:43 +0100)]
Don't check out files if we don't have index+workdir

It seems no one had tried to run a transaction without having an index
and a workdir, but this is exacly the situation we get when operating
on a stack other than the current one.

The fix is simple: don't try to check out.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't clean away patches with conflicts
Karl Hasselström [Sun, 27 Jan 2008 06:48:02 +0000 (07:48 +0100)]
Don't clean away patches with conflicts

If we have conflicts, it means that the topmost patch is empty because
of those conflicts (since StGit explicitly makes a conflicting patch
empty), so don't let "stg clean" touch it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd test to ensure that "stg clean" preserves conflicting patches
Pavel Roskin [Fri, 25 Jan 2008 08:55:17 +0000 (03:55 -0500)]
Add test to ensure that "stg clean" preserves conflicting patches

If "stg push" fails, the subsequent "stg clean" will remove the patch
that could not be applied. I think it's wrong. Especially when doing
"stg pull", it can happen that I want to run "stg clean" to get rid of
the patches applied upstream so I can concentrate on the conflict.
Instead, the conflicting patch is removed too.

The test added by this patch should pass once the bug is fixed.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet the caller supply the diff text to diffstat()
Karl Hasselström [Sun, 27 Jan 2008 13:31:31 +0000 (14:31 +0100)]
Let the caller supply the diff text to diffstat()

Almost all diffstat() callers already have the diff text, so they
might as well pass it to diffstat() instead of letting it recompute
it. In some cases this even makes for a code simplification since the
diff (and thus diffstat) parameters were nontrivial.

Also, diffstat() wasn't as versatile as diff(); for example, it didn't
accept any extra diff options. This patch solves all of those problems
as a side-effect.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSimplify editor selection logic
Karl Hasselström [Mon, 28 Jan 2008 20:19:34 +0000 (21:19 +0100)]
Simplify editor selection logic

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEliminate temp variable that's used just once
Karl Hasselström [Mon, 28 Jan 2008 21:20:09 +0000 (22:20 +0100)]
Eliminate temp variable that's used just once

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoWrap excessively long line
Karl Hasselström [Sun, 27 Jan 2008 12:27:35 +0000 (13:27 +0100)]
Wrap excessively long line

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoCreate index and worktree objects just once
Karl Hasselström [Sun, 27 Jan 2008 08:06:15 +0000 (09:06 +0100)]
Create index and worktree objects just once

Create the objects for a repository's default index, worktree, and
index+worktree just once. Both for performance (though the gain is
probably negligible), and for future-proofing if we ever add mutable
state to those objects.

And make them properties while we're at it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRefactor --diff-opts handling
Karl Hasselström [Thu, 24 Jan 2008 06:07:08 +0000 (07:07 +0100)]
Refactor --diff-opts handling

Lots of commands take a -O/--diff-opts flag, and they all handle it
identically. So break that out into a library function.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove unused default values
Karl Hasselström [Thu, 24 Jan 2008 06:08:57 +0000 (07:08 +0100)]
Remove unused default values

This function was called from only one place, and the default values
weren't used there, so they're useless.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoHomogenize buffer names
Karl Hasselström [Thu, 24 Jan 2008 06:30:32 +0000 (07:30 +0100)]
Homogenize buffer names

It was driving me crazy that I couldn't tab-complete "*stg" to
"*stgit*" because there was always a "*stgit edit*" buffer lying
around.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't keep old committer when rewriting a commit
Karl Hasselström [Thu, 24 Jan 2008 06:17:58 +0000 (07:17 +0100)]
Don't keep old committer when rewriting a commit

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoreplace "git repo-config" usage by "git config"
Peter Oberndorfer [Wed, 16 Jan 2008 20:58:26 +0000 (21:58 +0100)]
replace "git repo-config" usage by "git config"

This is necessary since "git repo-config" will be removed soon.

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoFix "stg edit --sign"
Pavel Roskin [Sat, 12 Jan 2008 04:58:03 +0000 (23:58 -0500)]
Fix "stg edit --sign"

It worked in 0.14, but was broken some time after the release.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDon't mention removed "stg refresh" options
Peter Oberndorfer [Tue, 8 Jan 2008 20:43:53 +0000 (21:43 +0100)]
Don't mention removed "stg refresh" options

Change usage string of refresh to not refer to removed options for
changing the patch author, commiter and description.

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake "stg goto" subdirectory safe
Karl Hasselström [Wed, 19 Dec 2007 21:12:20 +0000 (22:12 +0100)]
Make "stg goto" subdirectory safe

This is not specific to "stg goto" -- it affects all commands that use
the new infrastructure. (But of those, only goto and coalesce were
subdirectory unsafe.)

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTest that "stg goto" can be called from a subdirectory
Karl Hasselström [Wed, 19 Dec 2007 20:51:21 +0000 (21:51 +0100)]
Test that "stg goto" can be called from a subdirectory

It currently can't; therefore, the tests are marked as known failures.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: coalesce command
David Kågedal [Fri, 14 Dec 2007 08:59:49 +0000 (09:59 +0100)]
Emacs mode: coalesce command

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: Add mark command
David Kågedal [Fri, 14 Dec 2007 08:59:32 +0000 (09:59 +0100)]
Emacs mode: Add mark command

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake "stg commit" fancier
Karl Hasselström [Wed, 12 Dec 2007 22:48:56 +0000 (23:48 +0100)]
Make "stg commit" fancier

Allow the user to commit any patch. Changed behavior: with no
parameters, commit one applied patch, not all applied patches -- this
is what uncommit does.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoConvert "stg commit" to new infrastructure
Karl Hasselström [Wed, 12 Dec 2007 21:59:13 +0000 (22:59 +0100)]
Convert "stg commit" to new infrastructure

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSet exit code to 3 on merge conflict
Karl Hasselström [Wed, 12 Dec 2007 20:56:42 +0000 (21:56 +0100)]
Set exit code to 3 on merge conflict

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agostg coalesce: Support --file and --save-template
Karl Hasselström [Wed, 12 Dec 2007 20:08:46 +0000 (21:08 +0100)]
stg coalesce: Support --file and --save-template

--save-template was a bit tricky, because we want that

  * if we reached the stage where the message is needed without
    conflicts, the message should be written and no other side effects
    should occur; but

  * if we run into conflicts before reaching that point, behave just
    as if --save-template was not given.

This makes this script

  stg coalesce --save-template <patches>
  if template was saved:
    let user edit template
    if user didn't abort:
      stg coalesce --file <patches>

equivalent to

  stg coalesce <patches>

with the added benefit that the user can abort the whole thing without
visible side effects.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoExpose transaction abort function
Karl Hasselström [Thu, 13 Dec 2007 17:10:45 +0000 (18:10 +0100)]
Expose transaction abort function

Users of stack transactions may call abort() instead of run(), if they
wish to roll back the transaction instead of committing it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNew infrastructure: Make sure that the branch is initialized
Karl Hasselström [Thu, 29 Nov 2007 19:35:27 +0000 (20:35 +0100)]
New infrastructure: Make sure that the branch is initialized

The old infrastructure has been checking this for ages, but the new
forgot to do so until now.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoConvert "stg uncommit" to the new infrastructure
Karl Hasselström [Sun, 25 Nov 2007 04:29:16 +0000 (05:29 +0100)]
Convert "stg uncommit" to the new infrastructure

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet "stg goto" use the new infrastructure
Karl Hasselström [Sun, 9 Dec 2007 12:34:12 +0000 (13:34 +0100)]
Let "stg goto" use the new infrastructure

In the process, it loses the --keep option, since the new
infrastructure always keeps local changes (and aborts cleanly if they
are in the way).

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet "stg clean" use the new transaction primitives
Karl Hasselström [Sat, 24 Nov 2007 16:34:03 +0000 (17:34 +0100)]
Let "stg clean" use the new transaction primitives

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTeach the new infrastructure about the index and worktree
Karl Hasselström [Sun, 9 Dec 2007 07:56:12 +0000 (08:56 +0100)]
Teach the new infrastructure about the index and worktree

And use the new powers to make "stg coalesce" able to handle arbitrary
patches, not just consecutive applied patches.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove a newline from the e-mail template
Catalin Marinas [Wed, 19 Dec 2007 18:00:16 +0000 (18:00 +0000)]
Remove a newline from the e-mail template

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoRemove unused git functions like add, rm, copy
Catalin Marinas [Wed, 19 Dec 2007 18:00:15 +0000 (18:00 +0000)]
Remove unused git functions like add, rm, copy

They are no longer needed.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoRemove multiple stages returned by git.ls_files
Catalin Marinas [Wed, 19 Dec 2007 18:00:15 +0000 (18:00 +0000)]
Remove multiple stages returned by git.ls_files

This patch uses a set to return unique file names from git.ls_files in
case there are multiple stages in the index.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoDon't assume there is always a stage 2 in git.get_conflicts
Catalin Marinas [Wed, 19 Dec 2007 18:00:15 +0000 (18:00 +0000)]
Don't assume there is always a stage 2 in git.get_conflicts

For example, the t1202-push-undo.sh test generates a conflict where a
file was added in both current and patch but different content and
missing in ancestor, therefore no stage 2.

There could also be a case where stage 3 is missing if a file is
removed by the patch being pushed.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoRe-add the interactive merge
Catalin Marinas [Wed, 19 Dec 2007 18:00:15 +0000 (18:00 +0000)]
Re-add the interactive merge

This feature was dropped by previous changes to
git.merge_recursive(). This patch modifies gitmergeonefile.merge() to
only deal with interactive merges or simply check out the conflict
stages. The stgit.commands.common.resolved() function was moved to
git.resolved(). The patch also drops the git.merge() function since it
can no longer use gitmergeonefile.merge() (different API) and modifies
the 'sync' command to always use git.merge_recursive().

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoLet "stg applied" and "stg unapplied" use the new infrastructure
Karl Hasselström [Wed, 19 Dec 2007 18:00:15 +0000 (18:00 +0000)]
Let "stg applied" and "stg unapplied" use the new infrastructure

This is a trivial change since these commands are so simple, but
because these are the commands used by t4000-upgrade, we now test that
the new infrastructure can upgrade old stacks.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdd "stg coalesce"
Karl Hasselström [Wed, 19 Dec 2007 18:00:14 +0000 (18:00 +0000)]
Add "stg coalesce"

It coalesces two or more consecutive applied patches, with no need to
touch index/worktree, and no possibiliy of conflicts.

Future improvements could relax the "consecutive" and "applied"
restrictions, by building a new chain of commits just like "stg push"
will do once it's been converted to the new infrastructure.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet "stg clean" use the new infrastructure
Karl Hasselström [Wed, 19 Dec 2007 18:00:14 +0000 (18:00 +0000)]
Let "stg clean" use the new infrastructure

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUpgrade older stacks to newest version
Karl Hasselström [Wed, 19 Dec 2007 18:00:14 +0000 (18:00 +0000)]
Upgrade older stacks to newest version

This is of course needed by the new infrastructure as well. So break
it out into its own file, where it can be used by both new and old
infrastructure. This has the added benefit of making it easy to see
that the upgrade code doesn't depend on anything it shouldn't.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoWrite metadata files used by the old infrastructure
Karl Hasselström [Wed, 19 Dec 2007 18:00:14 +0000 (18:00 +0000)]
Write metadata files used by the old infrastructure

The new infrastructure doesn't use them, but they're needed to support
the old infrastructure during the transition when both of them are in
use.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNew StGit core infrastructure: repository operations
Karl Hasselström [Wed, 19 Dec 2007 18:00:14 +0000 (18:00 +0000)]
New StGit core infrastructure: repository operations

This is the first part of the New and Improved StGit core
infrastructure. It has functions for manipulating the git repository
(commits, refs, and so on), but doesn't yet touch the index or
worktree.

Currently not used by anything.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove "stg cp"
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
Remove "stg cp"

Plain old "cp" and git-add can do the job just as well.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove "stg rm"
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
Remove "stg rm"

git-rm can do the same job just as well. Besides, since StGit notices
when a file disappears, just "rm" can also do the job.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove "stg add"
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
Remove "stg add"

git-add does the exact same job, so there's no need to have it in
StGit.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoWe keep the different stages of a conflict in the index now
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
We keep the different stages of a conflict in the index now

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRefactoring: pass more than one file to resolved()
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
Refactoring: pass more than one file to resolved()

This lets us cut down on the number of calls to git.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoFix "stg resolved" to work with new conflict representation
Karl Hasselström [Wed, 19 Dec 2007 18:00:13 +0000 (18:00 +0000)]
Fix "stg resolved" to work with new conflict representation

The actual resolving is done by calling the same subroutine as "git
add".

Instead of using existing *.{ancestor,current,patches} files, the
interactive merge has to create them from the index contents, and
delete them afterwards.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoBetter error message if merge fails
Karl Hasselström [Wed, 19 Dec 2007 18:00:12 +0000 (18:00 +0000)]
Better error message if merge fails

This message is no longer printed in case of conflicts, just in case
the merge really failed; so don't talk about conflicts in the error
message.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAsk git about unmerged files
David Kågedal [Wed, 19 Dec 2007 18:00:12 +0000 (18:00 +0000)]
Ask git about unmerged files

Don't look in the "conflicts" file for that, since it isn't updated. Also
added a test that the check_conflicts() function works.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoNicer conflict markers
Karl Hasselström [Wed, 19 Dec 2007 18:00:12 +0000 (18:00 +0000)]
Nicer conflict markers

Instead of tagging the conflict markers with sha1 hashes, use
"ancestor", "current", and "patched".

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoUse the output from merge-recursive to list conflicts
David Kågedal [Wed, 19 Dec 2007 18:00:12 +0000 (18:00 +0000)]
Use the output from merge-recursive to list conflicts

merge-recursive already has useful information about what the conflicts
were, so we reuse that when pushing.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSimplify merge_recursive
David Kågedal [Wed, 19 Dec 2007 18:00:12 +0000 (18:00 +0000)]
Simplify merge_recursive

Listing the unmerged files is unnecessary, since the information
isn't really used anyway. Just note if the merge failed or succeeded.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdded a test case to check what happens when push finds a conflict
David Kågedal [Wed, 19 Dec 2007 18:00:11 +0000 (18:00 +0000)]
Added a test case to check what happens when push finds a conflict

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLeave working dir and index alone after failed (conflicting) push
David Kågedal [Wed, 19 Dec 2007 18:00:11 +0000 (18:00 +0000)]
Leave working dir and index alone after failed (conflicting) push

This leaves the index and working tree in the state that merge-recursive
left it, with unmerged files in different stages, and the non-conflicting
changes in the index.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoSplit git.merge into two functions
David Kågedal [Wed, 19 Dec 2007 18:00:11 +0000 (18:00 +0000)]
Split git.merge into two functions

This only prepares for later simplifications.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoWrite removed fields for backwards compatibility
Karl Hasselström [Wed, 19 Dec 2007 18:00:11 +0000 (18:00 +0000)]
Write removed fields for backwards compatibility

Start writing the "top", "bottom", and "bottom.old" fields again. The
last two patches mean we don't need them anymore, but old versions of
StGit still do.

At some later time, we'll want to change the stack on-disk format so
that these can be removed. But we'll probably want to do that as part
of a larger change.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove the 'top' field
David Kågedal [Wed, 19 Dec 2007 18:00:11 +0000 (18:00 +0000)]
Remove the 'top' field

The top is instead implicitly defined by the patch ref.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRemove the 'bottom' field
David Kågedal [Wed, 19 Dec 2007 18:00:10 +0000 (18:00 +0000)]
Remove the 'bottom' field

The bottom is instead always calculated from the top by getting its
parent commit.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoCheck bottom and invariants
David Kågedal [Wed, 19 Dec 2007 18:00:10 +0000 (18:00 +0000)]
Check bottom and invariants

This code adds some checks that the bottom is actually always the
parent of top.

It also checks that the top is the same as what the patch ref points
to.

This is only to ensure that the next patches are correct.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: Added stgit-new
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: Added stgit-new

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: added fontification
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: added fontification

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: Add stgit-edit command
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: Add stgit-edit command

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: added stgit-commit and stgit-uncommit
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: added stgit-commit and stgit-uncommit

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: add stgit-repair
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: add stgit-repair

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: Bind n and p
David Kågedal [Wed, 19 Dec 2007 18:00:09 +0000 (18:00 +0000)]
Emacs mode: Bind n and p

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: Improve the output buffer state
David Kågedal [Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)]
Emacs mode: Improve the output buffer state

Make the output buffer have the correct default-directory, and make it
read-only and unmodified.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoEmacs mode: show patches' short description
Karl Hasselström [Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)]
Emacs mode: show patches' short description

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: Bind "G" to "stg goto"
Karl Hasselström [Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)]
Emacs mode: Bind "G" to "stg goto"

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: Let "P" push or pop patch at point
Karl Hasselström [Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)]
Emacs mode: Let "P" push or pop patch at point

When the user presses "P", push or pop the patch at point depending on
whether it's applied or unapplied.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: push/pop next patch, not patch at point
Karl Hasselström [Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)]
Emacs mode: push/pop next patch, not patch at point

The three operations we should have are:

  * Pop the topmost applied patch, no matter where point is.

  * Push the first unapplied patch, no matter where point is.

  * Push/pop the patch at point, depending on whether it's currently
    applied.

This patch makes "<" and ">" do the first two operations. The third is
coming in a later patch.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: Makefile for building stgit.el
Karl Hasselström [Wed, 19 Dec 2007 18:00:07 +0000 (18:00 +0000)]
Emacs mode: Makefile for building stgit.el

Shamelessly stolen from git's contrib/emacs/Makefile.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: Add an explanatory header
Karl Hasselström [Wed, 19 Dec 2007 18:00:07 +0000 (18:00 +0000)]
Emacs mode: Add an explanatory header

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoEmacs mode: Show keybindings when user presses "h" or "?"
Karl Hasselström [Wed, 19 Dec 2007 18:00:07 +0000 (18:00 +0000)]
Emacs mode: Show keybindings when user presses "h" or "?"

These are the same keys the git emacs mode uses.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
16 years agoAdd an StGit mode for emacs
David Kågedal [Wed, 19 Dec 2007 18:00:07 +0000 (18:00 +0000)]
Add an StGit mode for emacs

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoName the exit codes to improve legibility
Karl Hasselström [Wed, 12 Dec 2007 22:44:12 +0000 (23:44 +0100)]
Name the exit codes to improve legibility

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake generic --message/--file/--save-template flags
Karl Hasselström [Wed, 12 Dec 2007 23:13:55 +0000 (00:13 +0100)]
Make generic --message/--file/--save-template flags

And let "stg edit" use them.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoLet parse_patch take a string instead of a file parameter
Karl Hasselström [Wed, 12 Dec 2007 21:33:32 +0000 (22:33 +0100)]
Let parse_patch take a string instead of a file parameter

This makes it more generally useful, since all future callers may not
have the input in a file.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoTreat filename '-' as stdin/stdout in edit
David Kågedal [Mon, 10 Dec 2007 21:43:55 +0000 (22:43 +0100)]
Treat filename '-' as stdin/stdout in edit

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoAdded --save-template flag to edit command
David Kågedal [Tue, 11 Dec 2007 11:00:16 +0000 (12:00 +0100)]
Added --save-template flag to edit command

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRelease 0.14.1 v0.14.1
Catalin Marinas [Tue, 11 Dec 2007 23:51:54 +0000 (23:51 +0000)]
Release 0.14.1

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoFix typo: we require Python 2.4, not 2.5
Karl Hasselström [Tue, 11 Dec 2007 14:23:47 +0000 (15:23 +0100)]
Fix typo: we require Python 2.4, not 2.5

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoRelease 0.14 v0.14
Catalin Marinas [Sun, 9 Dec 2007 23:45:08 +0000 (23:45 +0000)]
Release 0.14

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoBetter handling of binary files (bug #8495)
Catalin Marinas [Sun, 9 Dec 2007 23:32:58 +0000 (23:32 +0000)]
Better handling of binary files (bug #8495)

The patch adds the '--binary' option to the git-diff-tree and git-diff-index
commands. The git-apply no longer needs this flag as it is set by default.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAllow only certain gitk exit codes as valid
Catalin Marinas [Sat, 8 Dec 2007 23:16:30 +0000 (23:16 +0000)]
Allow only certain gitk exit codes as valid

This patch fixes the log and series commands to not report an error when
gitk is killed by the user.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoDon't use test_expect_failure for tests that are supposed to work
Karl Hasselström [Sat, 8 Dec 2007 11:00:10 +0000 (12:00 +0100)]
Don't use test_expect_failure for tests that are supposed to work

test_expect_failure is only for marking known bugs.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoDiscard exitcode of subprocess in a better way
Karl Hasselström [Sat, 8 Dec 2007 08:27:22 +0000 (09:27 +0100)]
Discard exitcode of subprocess in a better way

Discard the exit code in a way that meshes better with the existing
handling of exit codes.

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoFix bashism
Karl Hasselström [Sat, 8 Dec 2007 09:30:40 +0000 (10:30 +0100)]
Fix bashism

Signed-off-by: Karl Hasselström <kha@treskal.com>
16 years agoMake sure the refid given to 'mail' has the angle brackets
Catalin Marinas [Fri, 7 Dec 2007 21:19:25 +0000 (21:19 +0000)]
Make sure the refid given to 'mail' has the angle brackets

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoSome clean-up of the branch manipulation commands
Catalin Marinas [Fri, 7 Dec 2007 21:19:25 +0000 (21:19 +0000)]
Some clean-up of the branch manipulation commands

A GIT branch couldn't be deleted if it wasn't a StGIT stack. Added
tests for the creation of branches when the current branch isn't a
stack.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoIgnore the gitk exit code in 'stg log -g' (bug #10010)
Catalin Marinas [Fri, 7 Dec 2007 21:19:25 +0000 (21:19 +0000)]
Ignore the gitk exit code in 'stg log -g' (bug #10010)

The patch adds the 'exitcode' boolean argument to Run.run() and
modifies the 'log' command.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd the 'log --number' option to limit the output
Catalin Marinas [Fri, 7 Dec 2007 21:19:25 +0000 (21:19 +0000)]
Add the 'log --number' option to limit the output

The patch also changes the construction of the string when --patch is
supplied to avoid resource consumption (using a list and joining at
the end rather than creating a bigger and bigger string).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoChange the file timestamp in 'resolved --reset' (bug #10017)
Catalin Marinas [Fri, 7 Dec 2007 21:19:24 +0000 (21:19 +0000)]
Change the file timestamp in 'resolved --reset' (bug #10017)

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAllow 'show' and 'id' to work on non-StGIT branches (bug #10011)
Catalin Marinas [Fri, 7 Dec 2007 21:19:24 +0000 (21:19 +0000)]
Allow 'show' and 'id' to work on non-StGIT branches (bug #10011)

Some clean-up to only access the current series object if needed.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agogit.pretty_commit() re-implemented with "git show" (bug #10018)
Catalin Marinas [Fri, 7 Dec 2007 21:16:36 +0000 (21:16 +0000)]
git.pretty_commit() re-implemented with "git show" (bug #10018)

This way, it honours the diff.renames etc. options.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoCheck the minimum required versions of GIT and Python (bug #10218)
Catalin Marinas [Fri, 7 Dec 2007 21:16:36 +0000 (21:16 +0000)]
Check the minimum required versions of GIT and Python (bug #10218)

The patch modifies the setup.py script to check the minimum versions
of GIT and Python required for building and installing StGIT. They are
currently set to git-1.5.2 and Python-2.4.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAdd a test for the 'mail --attach' command
Catalin Marinas [Fri, 7 Dec 2007 21:16:36 +0000 (21:16 +0000)]
Add a test for the 'mail --attach' command

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoAllow multipart templates for patch e-mails (bug #10237)
Catalin Marinas [Thu, 6 Dec 2007 23:28:42 +0000 (23:28 +0000)]
Allow multipart templates for patch e-mails (bug #10237)

If the template is a multipart MIME message, it sets the charset only to
the payloads. The patch also adds the '--attach' option to 'mail' which uses
the templates/mailattch.tmpl template file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoClean-up if the branch creation fails (bug #10015)
Catalin Marinas [Tue, 4 Dec 2007 21:46:14 +0000 (21:46 +0000)]
Clean-up if the branch creation fails (bug #10015)

If the tree switching fails during the branch creation, the new head
will be reverted and the new branch deleted.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
16 years agoCorrectly identify the parent branch (bug #10014)
Catalin Marinas [Mon, 3 Dec 2007 10:30:20 +0000 (10:30 +0000)]
Correctly identify the parent branch (bug #10014)

Any valid git ref was identified as a possible parent branch. This patch
adds a check for the refs listed by git-show-ref.

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