stgit
18 years agouse "crt_series.get_branch()" instead of "git.get_head_file()"
Chuck Lever [Mon, 14 Nov 2005 16:50:57 +0000 (11:50 -0500)]
use "crt_series.get_branch()" instead of "git.get_head_file()"

More cleanup to the branch command.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoBetter error message when renaming patches to same name
Chuck Lever [Mon, 14 Nov 2005 16:50:55 +0000 (11:50 -0500)]
Better error message when renaming patches to same name

Generate a more precise error message when trying to rename a patch to the
same name.  This is what we get currently:

  [cel@dexter main]$ stg rename nfs_direct_wait nfs_direct_wait
  Renaming patch "nfs_direct_wait" -> "nfs_direct_wait"...stg rename: Patch
  "nfs_direct_wait" already exists

  [cel@dexter main]$

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix the --name option for the pick command
Catalin Marinas [Fri, 11 Nov 2005 10:12:46 +0000 (10:12 +0000)]
Fix the --name option for the pick command

If a patch name from a different branch is given, the --name option is
ignored.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise pick --fold to use git-apply first
Catalin Marinas [Thu, 10 Nov 2005 14:28:42 +0000 (14:28 +0000)]
Optimise pick --fold to use git-apply first

If "git-diff-tree | git-apply" fails, the command falls back to a
three-way merge.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoDifferent fixes for the branch command
Catalin Marinas [Wed, 9 Nov 2005 21:57:38 +0000 (21:57 +0000)]
Different fixes for the branch command

Mainly checks for local changes were added and some typos.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoGeneralize branch renaming
Chuck Lever [Sat, 5 Nov 2005 22:47:06 +0000 (17:47 -0500)]
Generalize branch renaming

The Series object already has the path names of all the pieces we need to
rename, so let's reuse that information.  Extract the rename branch logic
from the "stg branch" command and put it in stack.py.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a stack method for determining whether a branch is initialised
Chuck Lever [Wed, 2 Nov 2005 21:55:46 +0000 (16:55 -0500)]
Add a stack method for determining whether a branch is initialised

Let's be consistent about how we decide whether a branch is ready for use
by stgit.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoReplace a variable that uses the same name as a built-in
Chuck Lever [Wed, 2 Nov 2005 21:55:42 +0000 (16:55 -0500)]
Replace a variable that uses the same name as a built-in

Maintainability: "str" hides the name of a Python built-in function
(found by pychecker).

I've also replaced the use of the variable "string" throughout, as it
hides the name of the Python 'string' module.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix up help string for "stg clone"
Chuck Lever [Wed, 2 Nov 2005 21:55:39 +0000 (16:55 -0500)]
Fix up help string for "stg clone"

The help string for "stg clone" is the same as the one for "stg pull".

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago"stg export" error message could be more specific
Chuck Lever [Wed, 2 Nov 2005 21:55:37 +0000 (16:55 -0500)]
"stg export" error message could be more specific

Like similar previous patches, make "stg export" distinguish between an
unapplied patch and a non-existent one when reporting a failure.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoremove extra refresh_index() call in apply_patches()
Chuck Lever [Wed, 2 Nov 2005 21:55:35 +0000 (16:55 -0500)]
remove extra refresh_index() call in apply_patches()

apply_patches() calles git.merge() and git.switch(), both of which already
invoke refresh_index().

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a space after ',' when building the e-mail recipients headers
Catalin Marinas [Fri, 4 Nov 2005 17:33:50 +0000 (17:33 +0000)]
Add a space after ',' when building the e-mail recipients headers

This patch also untabifies the mail.py file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise the export command
Catalin Marinas [Fri, 4 Nov 2005 16:05:09 +0000 (16:05 +0000)]
Optimise the export command

This patch replaces the call to git_id with patch.get_(top|bottom).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a patches command
Catalin Marinas [Fri, 4 Nov 2005 16:05:06 +0000 (16:05 +0000)]
Add a patches command

This command shows the patches that modify a given file.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the 'files' initialisation in git.checkout()
Catalin Marinas [Fri, 4 Nov 2005 10:27:22 +0000 (10:27 +0000)]
Fix the 'files' initialisation in git.checkout()

The 'files' variable should have been initialised to an empty list, not
None. Thanks to Kai Ruemmler for spotting it.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUsing a mutable default function argument is bad
Chuck Lever [Wed, 26 Oct 2005 18:51:54 +0000 (14:51 -0400)]
Using a mutable default function argument is bad

Python function arguments can have default values.  These values are
objects that are created when the "def" statement is run, not when the
function is called.  These objects are thus persistent across calls to
that function.  If a mutable object, such as a list, is used as a
default argument, that object will retain its value across function
calls.  This is potentially unwanted behavior if the function is called
multiple times.

Fix up function argument defaults in stgit/git.py, for safety.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd an option to delete a patch from a certain branch
Paolo \'Blaisorblade\' Giarrusso [Mon, 31 Oct 2005 20:54:47 +0000 (21:54 +0100)]
Add an option to delete a patch from a certain branch

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Actually, simply adding the option is enough...
Restrict print_crt_patch() to the case when we didn't specify --branch (as it's
useless otherwise).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoCapture the KeyboardInterrupt exception
Catalin Marinas [Thu, 27 Oct 2005 19:47:25 +0000 (20:47 +0100)]
Capture the KeyboardInterrupt exception

This is to avoid a stack back-trace when a command is interrupted by the
user.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoNotify when a cherry-picked commit was modified by 'pick'
Catalin Marinas [Thu, 27 Oct 2005 19:47:24 +0000 (20:47 +0100)]
Notify when a cherry-picked commit was modified by 'pick'

The logic is similar to the 'push' command one (i.e. it is reported as
modified if a three-way merge is needed).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoNotify when a patch was modified during a push operation
Catalin Marinas [Thu, 27 Oct 2005 19:47:24 +0000 (20:47 +0100)]
Notify when a patch was modified during a push operation

The logic of this is that when a "git-diff | git-apply" succeeds, the patch
is reported as unmodified. If the the above operation fails and the command
falls back to a three-way merge, the patch will be reported as modified.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse __run instead of os.system() in git.merge()
Chuck Lever [Wed, 26 Oct 2005 18:52:00 +0000 (14:52 -0400)]
Use __run instead of os.system() in git.merge()

This is just a little faster, avoiding an unneeded invocation of the shell.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoPrevent stderr from appearing on stdout when running commands
Chuck Lever [Wed, 26 Oct 2005 18:51:58 +0000 (14:51 -0400)]
Prevent stderr from appearing on stdout when running commands

The original purpose was to eliminate "fatal: Needed single revision" when
a ref didn't exist, but this seems like an overall good thing to do to help
with output cleanliness..

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoNeed to do "git-update-index --refresh" in more places
Chuck Lever [Wed, 26 Oct 2005 18:51:56 +0000 (14:51 -0400)]
Need to do "git-update-index --refresh" in more places

Recent changes to the git porcelain-ish shell scripts added
"git-update-index --refresh" in several places.  This harmlessly allows
a dirty tree during certain operations that use git-read-tree.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoPrint the git version when running the "stg version" command
Chuck Lever [Wed, 26 Oct 2005 18:51:51 +0000 (14:51 -0400)]
Print the git version when running the "stg version" command

"git --version" was added only recently.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago"stg mail" doesn't distinguish between unapplied and non-existent patches
Chuck Lever [Wed, 26 Oct 2005 18:51:49 +0000 (14:51 -0400)]
"stg mail" doesn't distinguish between unapplied and non-existent patches

Same fix as the recent fixes to "pop" and "push".

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoMake listing branches more efficient
Chuck Lever [Wed, 26 Oct 2005 18:51:47 +0000 (14:51 -0400)]
Make listing branches more efficient

Listing branches appears to "init" the series twice for each branch in
the list.  Similarly for deleting a branch.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoMake switching to the current branch a no-op
Chuck Lever [Wed, 26 Oct 2005 18:51:45 +0000 (14:51 -0400)]
Make switching to the current branch a no-op

Check if "stg branch name" is switching to the branch we are already in,
and make that case a no-op.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoFix exception error message in git.merge()
Chuck Lever [Wed, 26 Oct 2005 18:51:43 +0000 (14:51 -0400)]
Fix exception error message in git.merge()

Due to recent big git script rename.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoGet rid of an unused variable
Chuck Lever [Wed, 26 Oct 2005 18:51:41 +0000 (14:51 -0400)]
Get rid of an unused variable

"git_opt" is unused in the rm() function.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoMake sure switch_branch uses the right __head
Chuck Lever [Wed, 26 Oct 2005 18:51:38 +0000 (14:51 -0400)]
Make sure switch_branch uses the right __head

"switch_branch" needs to use the global variable __head, not a local
version.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoRemove unused import in stgit/git.py
Chuck Lever [Wed, 26 Oct 2005 18:51:34 +0000 (14:51 -0400)]
Remove unused import in stgit/git.py

The "glob" module isn't used in stgit/git.py, so don't import it.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoGive the global "crt_series" variable a default value
Chuck Lever [Wed, 26 Oct 2005 18:51:32 +0000 (14:51 -0400)]
Give the global "crt_series" variable a default value

The Python interpreter was searching every scope to find crt_series.  By
providing a default value, this reduces the amount of searching the
interpreter does looking for crt_series.

I've noticed that most commands are faster with this change.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAsk vim to avoid backup copies of .stgit.msg
Paolo \'Blaisorblade\' Giarrusso [Thu, 27 Oct 2005 08:56:34 +0000 (10:56 +0200)]
Ask vim to avoid backup copies of .stgit.msg

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Do this by adding nobackup to the modeline.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoParse /top.old with id and when requesting diffs
Paolo \'Blaisorblade\' Giarrusso [Thu, 27 Oct 2005 08:56:22 +0000 (10:56 +0200)]
Parse /top.old with id and when requesting diffs

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Comparing a patch after and before a merge is very important, and looking into
.git/patches by hand is not the nicer way to do it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoAllow the editing of the cover message before sending it by e-mail
Catalin Marinas [Fri, 21 Oct 2005 13:25:23 +0000 (14:25 +0100)]
Allow the editing of the cover message before sending it by e-mail

When sending e-mails, it is easier to automatically invoke the editor on
the cover message than writing it separately. This patch renames the
--first option to --cover and allows a --edit option to edit the final
message before sending it. With --edit only, the tool will use the default
template in .git/covermail.tmpl or
/usr/share/stgit/templates/covermail.tmpl.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the branch protect/unprotect message
Catalin Marinas [Mon, 17 Oct 2005 14:50:19 +0000 (15:50 +0100)]
Fix the branch protect/unprotect message

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFlush the HEAD cache in set_head_file()
Catalin Marinas [Fri, 7 Oct 2005 21:15:38 +0000 (22:15 +0100)]
Flush the HEAD cache in set_head_file()

This function also changes the value read from the HEAD link but it didn't
flush the internal cached value.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix a bug in "stg branch --rename"
Chuck Lever [Thu, 6 Oct 2005 20:59:55 +0000 (21:59 +0100)]
Fix a bug in "stg branch --rename"

We were using the wrong pathname when setting HEAD.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago[PATCH] Fix a couple of bugs in "stg branch --create"
Chuck Lever [Thu, 6 Oct 2005 20:58:01 +0000 (21:58 +0100)]
[PATCH] Fix a couple of bugs in "stg branch --create"

Use "switch()" instead of "git.switch()".  Also, __set_head is a little
more complicated now, so a __clear_head_cache() is needed before we call it.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd support for branch description files
Chuck Lever [Thu, 6 Oct 2005 12:57:40 +0000 (13:57 +0100)]
Add support for branch description files

These are single line files that are displayed by "stg branch --list".

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAllow user to protect some branches against "stg pull"
Chuck Lever [Thu, 6 Oct 2005 12:57:12 +0000 (13:57 +0100)]
Allow user to protect some branches against "stg pull"

Sometimes we want to develop against a branch that doesn't evolve (eg.
2.6.12).  To prevent an accidental "stg pull", provide two new options to
stg: "--protect" and "--unprotect".  This also prevents deleting any
patches in the series.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoRudimentary support for multiple development branches
Chuck Lever [Thu, 6 Oct 2005 12:56:42 +0000 (13:56 +0100)]
Rudimentary support for multiple development branches

 stg branch

   show the name of the current branch.

 stg branch <branch-name>

   switch to the named branch.  after the switch is complete,
   all currently applied patches in the target branch are
   applied.

 stg branch --create <branch-name> [ <commit-sha1> ]

   create a new branch.  if <commit-sha1> is not specified then
   the branch is created starting at the commit pointed to by
   the current HEAD.  otherwise, the branch is created starting
   at the given commit.

   when the branch creation completes, the new branch becomes
   the current branch.

 stg branch --delete [ <branch-name> ]

   delete a branch and all patches it contains.  if no name is
   specified, delete the current branch and switch to the
   "master" branch.  otherwise, delete the named branch.

 stg branch --list

   list all the development branches in the current repository
   along with their descriptions and status.

 stg branch --rename <from-branch-name> <to-branch-name>

   rename a branch, and switch to the new name.

 stg branch -h

   print a synopsis of the "stg branch" command.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAllow print_crt_patch to work on other branches
Chuck Lever [Thu, 6 Oct 2005 10:20:14 +0000 (11:20 +0100)]
Allow print_crt_patch to work on other branches

print_crt_patch() current prints the current patch in the current branch.
Add a function argument to allow it to print the current patch in other
branches.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd the ability to rename a git branch
Chuck Lever [Thu, 6 Oct 2005 10:19:22 +0000 (11:19 +0100)]
Add the ability to rename a git branch

To keep StGit-specific functionality separate from git functionality,
create a git.rename_branch function to do appropriate sanity checking and
rename branch heads.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd the ability to delete a branch to git.py
Chuck Lever [Thu, 6 Oct 2005 10:18:18 +0000 (11:18 +0100)]
Add the ability to delete a branch to git.py

"git branch -D" checks first to see whether all the commits in the doomed
branch are already in the branch pointed to by HEAD.  I don't think we need
that level of checking here.  We just delete "refs/heads/branchname."

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd git method for switching to a different branch
Chuck Lever [Thu, 6 Oct 2005 10:17:50 +0000 (11:17 +0100)]
Add git method for switching to a different branch

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd git method for creating a fresh branch
Chuck Lever [Thu, 6 Oct 2005 10:17:48 +0000 (11:17 +0100)]
Add git method for creating a fresh branch

Basically this is "git checkout -b".

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoCreate a new utility function in git.py for setting the HEAD link
Chuck Lever [Thu, 6 Oct 2005 10:12:44 +0000 (11:12 +0100)]
Create a new utility function in git.py for setting the HEAD link

Add a new method in git.py for switching the HEAD link to point to a
different ref.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdd a stack method to delete a patch series
Chuck Lever [Thu, 6 Oct 2005 10:12:06 +0000 (11:12 +0100)]
Add a stack method to delete a patch series

In preparation to introducing the ability to delete a branch, add a stack
method that will iterate over a patch series and delete each patch.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAllow the short version of --base (i.e. -b) in import
Catalin Marinas [Thu, 6 Oct 2005 10:07:08 +0000 (11:07 +0100)]
Allow the short version of --base (i.e. -b) in import

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse git_id in import and fold instead of git.rev_parse
Catalin Marinas [Thu, 6 Oct 2005 09:57:17 +0000 (10:57 +0100)]
Use git_id in import and fold instead of git.rev_parse

git_id() is more flexible since it knows about StGIT patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the caching of the HEAD value
Catalin Marinas [Thu, 6 Oct 2005 09:52:52 +0000 (10:52 +0100)]
Fix the caching of the HEAD value

'git pull' also updates the HEAD but StGIT did not flush the cached value
causing problems with pulling.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a --reset option to resolved
Catalin Marinas [Wed, 5 Oct 2005 15:58:18 +0000 (16:58 +0100)]
Add a --reset option to resolved

With this option one can ask for a conflicted file to be reset to one of
the local, remote or older states.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAllow git.apply_patch() to take a base revision
Catalin Marinas [Wed, 5 Oct 2005 15:58:18 +0000 (16:58 +0100)]
Allow git.apply_patch() to take a base revision

This option is useful for import --base and fold commands. Both these
commands were modified to take advantage of it. The fold commands also
supports a --base option, similar to the import one.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a --fold option to pick
Catalin Marinas [Wed, 5 Oct 2005 15:58:18 +0000 (16:58 +0100)]
Add a --fold option to pick

This option causes the given commit object to be merged into the current
patch instead of creating a new one.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoTODO updated with the need for a 'prune' command
Catalin Marinas [Wed, 5 Oct 2005 15:58:10 +0000 (16:58 +0100)]
TODO updated with the need for a 'prune' command

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years ago'status --reset' should remove the conflicts as well
Catalin Marinas [Wed, 5 Oct 2005 08:32:08 +0000 (09:32 +0100)]
'status --reset' should remove the conflicts as well

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the --reset option to status
Catalin Marinas [Tue, 4 Oct 2005 19:56:18 +0000 (20:56 +0100)]
Add the --reset option to status

This option resets all the changes in the current tree (relative to HEAD).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd an uninstallable script for profiling
Catalin Marinas [Tue, 4 Oct 2005 19:56:18 +0000 (20:56 +0100)]
Add an uninstallable script for profiling

The script name is stg-prof and can be used instead stg for printing
profiling information.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoMake __commits global in git.py
Catalin Marinas [Tue, 4 Oct 2005 19:56:18 +0000 (20:56 +0100)]
Make __commits global in git.py

Some weird errors with Python scoping for the __head global variable
required the use of global. Add it for this variable as well.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCache the HEAD value
Catalin Marinas [Tue, 4 Oct 2005 19:56:18 +0000 (20:56 +0100)]
Cache the HEAD value

There are many calls to git.get_head(). This value should be cached to
speed things up.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse "git-rev-parse" to get the HEAD commit
Chuck Lever [Mon, 3 Oct 2005 17:03:31 +0000 (13:03 -0400)]
Use "git-rev-parse" to get the HEAD commit

Traditionally, HEAD was just a link to a refs file.  Recently, however,
support for HEADs of the form "ref: " was added to git.  In addition,
it's safer to verify the HEAD commit id before using it.

Change git.py to use "git-rev-parse" to derive the HEAD commit instead of
reading the HEAD link directly.  If there are any problems with the HEAD
commit id, git.get_head() now raises an exception.

And, use "git-update-ref" to update the HEAD for similar reasons.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoUse a more clear message when pop or push can't apply a patch
Chuck Lever [Tue, 4 Oct 2005 19:56:05 +0000 (20:56 +0100)]
Use a more clear message when pop or push can't apply a patch

Minor nit: the error message when "stg pop" or "stg push" can't apply a
patch is vague.  Add a little extra logic to print a more precise error
message in these cases.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoEscape the unusual characters in the name <email> strings
Catalin Marinas [Mon, 3 Oct 2005 17:33:49 +0000 (18:33 +0100)]
Escape the unusual characters in the name <email> strings

Otherwise there are problems when passing the environment to git-commit.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise 'push' to use git-apply instead of git-read-tree
Catalin Marinas [Mon, 3 Oct 2005 14:35:40 +0000 (15:35 +0100)]
Optimise 'push' to use git-apply instead of git-read-tree

With this patch, 'push' will use 'git-diff-tree | git-apply' first. If this
operation fails, it will fall back to the three-way merge with
git-read-tree.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoRelease 0.7 v0.7
Catalin Marinas [Sun, 2 Oct 2005 07:45:53 +0000 (08:45 +0100)]
Release 0.7

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUpdate the TODO file
Catalin Marinas [Sun, 2 Oct 2005 07:33:36 +0000 (08:33 +0100)]
Update the TODO file

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a commit command to merge the current patches into base
Catalin Marinas [Tue, 27 Sep 2005 20:27:33 +0000 (21:27 +0100)]
Add a commit command to merge the current patches into base

By default, the base is only advanced by 'stg pull'. A commit command would
allow the currently applied patches to be merged into the base and removed
from the current series. This commands adds a bit of SCM flavour to StGIT.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoImplement a 'pick' command for cherry-picking
Catalin Marinas [Tue, 27 Sep 2005 16:29:48 +0000 (17:29 +0100)]
Implement a 'pick' command for cherry-picking

The initial cherry-picking implementation in import was quite hard to find
and the import command became pretty hard to use.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCancel the commit cherry-picking in import
Catalin Marinas [Fri, 16 Sep 2005 13:05:06 +0000 (14:05 +0100)]
Cancel the commit cherry-picking in import

This feature will be added to a separate command, 'pick'.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd support for branch in the patch id
Catalin Marinas [Tue, 27 Sep 2005 15:11:00 +0000 (16:11 +0100)]
Add support for branch in the patch id

By default, only patch/top and patch/bottom on the current branch are
supported. This patch adds the patch@branch/... support.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd support for git-rev-parse
Catalin Marinas [Tue, 27 Sep 2005 13:59:52 +0000 (14:59 +0100)]
Add support for git-rev-parse

The git_id() function now calls git.rev_parse() if it cannot get the id.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix earlier "import quilt patches" patch
Paolo 'Blaisorblade' Giarrusso [Sat, 24 Sep 2005 10:46:23 +0000 (12:46 +0200)]
Fix earlier "import quilt patches" patch

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

I forgot to update all cases - I updated __parse_mail, not __parse_patch, so
refactor together this duplication and use the fixed version.

Btw, I don't like those regexps - they'd match in the middle of line too. What
about adding ^ to their beginning like for the "^Index: " regexp?

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoMinor typos in the tutorial
Catalin Marinas [Sun, 25 Sep 2005 08:16:17 +0000 (09:16 +0100)]
Minor typos in the tutorial

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the tutorial back to the repository
Catalin Marinas [Fri, 23 Sep 2005 13:15:38 +0000 (14:15 +0100)]
Add the tutorial back to the repository

This is to avoid problems when the site is down. At the moment, the
tutorial on the wiki was only converted to plain text and added. It might
be out of date for some commands or options.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix importing from stdin
Catalin Marinas [Thu, 22 Sep 2005 16:43:36 +0000 (17:43 +0100)]
Fix importing from stdin

The current stdin patch importing expects two EOFs since the 'for' loop
doesn't start before one EOF is received. As suggested, this patch changes
the 'for' loop with a 'while True' loop.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCut verbosity of new fast-forward merging
Chuck Lever [Wed, 21 Sep 2005 18:01:45 +0000 (14:01 -0400)]
Cut verbosity of new fast-forward merging

Now "stg push" will report only that is "Fast-forwarding" or "Pushing"
a patch.  The messages about trying to fast-forward and failing are
gone.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago"stg series" on an un-inited branch gives weird error
Chuck Lever [Wed, 21 Sep 2005 18:01:43 +0000 (14:01 -0400)]
"stg series" on an un-inited branch gives weird error

If I try an "stg series" command on a repository that hasn't yet been
initialized, I get a non-intuitive error message:

stg series: [Errno 2] No such file or directory:
'/home/cel/src/git/main/.git/patches/master/applied'

This patch replaces the message with a reasonable explanation.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoAdjust stgit for post 0.99.7 renames.
Junio C Hamano [Fri, 9 Sep 2005 09:24:05 +0000 (02:24 -0700)]
Adjust stgit for post 0.99.7 renames.

Not to be used with version of git 0.99.6 and earlier.
Using the new names with current "master" branch is OK.
The old names will be removed in 0.99.8.

18 years agoFix series mismerge
Paolo 'Blaisorblade' Giarrusso [Sun, 18 Sep 2005 16:47:12 +0000 (18:47 +0200)]
Fix series mismerge

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Mismerge with my addition of -e. Sorry for not pulling that time.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix syntax error in stg status
Paolo 'Blaisorblade' Giarrusso [Sun, 18 Sep 2005 18:15:51 +0000 (20:15 +0200)]
Fix syntax error in stg status

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Uff, it's becoming annoying - why things break so often? However, more to the
point: turn a string into a list to allow appending it to another list.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix the version_str assignment in mail.py
Catalin Marinas [Sun, 18 Sep 2005 08:12:35 +0000 (09:12 +0100)]
Fix the version_str assignment in mail.py

The variable is used before it is initialised.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoBetter mail handling in stgit
Pierre Ossman [Sun, 18 Sep 2005 08:07:34 +0000 (09:07 +0100)]
Better mail handling in stgit

Fix some issues with the mail function in StGIT:

 * Allow multiple To/Cc/Bcc command line options.

 * Better parsing of mail addresses.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
18 years agoSpecify a different base for the imported patch
Catalin Marinas [Sun, 18 Sep 2005 08:02:37 +0000 (09:02 +0100)]
Specify a different base for the imported patch

This option will import a patch on a different base and perform a three-way
merge with the current HEAD.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoCheck whether the patch name is applied or unapplied
Catalin Marinas [Sat, 17 Sep 2005 08:12:26 +0000 (09:12 +0100)]
Check whether the patch name is applied or unapplied

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoDetect description in quilt patches
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:25 +0000 (21:35 +0200)]
Detect description in quilt patches

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

The current logic imports the whole quilt patch as description - the changes
themselves are correctly applied, luckily, but the description must be fixed up
by hand.
So, detect "Index: " lines as patch start. I've heard rumors that also
Subversion generates this format, so we become compatible with it, too.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix "stg mail" address parsing for hyphen
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:23 +0000 (21:35 +0200)]
Fix "stg mail" address parsing for hyphen

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Tried sending an email cc'ing LKML - watched my postfix queue - and saw
kernel@vger.kernel.org as delivery address! What had happened? StGIT didn't like
"linux-kernel" ! Fix the regexp.

I just added an hyphen to both sections (yes, there are plenty of domain names
including hyphens, and I tested the problem there too). Don't know if other
chars are missing.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoAllow mailing a given patch list
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:22 +0000 (21:35 +0200)]
Allow mailing a given patch list

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

I tried to mail a cherry-picked subset of my series and that didn't work - using
stg export and quilt was even worse, so I had to code something.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix "stg clean" when stack is empty
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:21 +0000 (21:35 +0200)]
Fix "stg clean" when stack is empty

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

It crashes on accessing 1st element of an empty array.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoImplement fast-forward when only tree (but not
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:20 +0000 (21:35 +0200)]
Implement fast-forward when only tree (but not

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

When the "bottom" commit and the HEAD don't match, but they refer to the
same tree (for instance after a refresh where only the description
changed), we can still fast-forward, by keeping the same top tree and
calling git-commit-tree (which only requires the tree object) with the new
parent. I've altered git.commit to allow this.

Btw, I've also avoided the use of .commitmsg and switched to piping the
description.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoAvoid allowing --undo if it doesn't change anything
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:19 +0000 (21:35 +0200)]
Avoid allowing --undo if it doesn't change anything

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Avoid top/bottom backup files identical to current ones. Simply remove
them.

Also, change restore_old_boundaries() to handle gracefully the new
situation rather than print an exception.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoMake "stg files" output match "quilt files" one
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:17 +0000 (21:35 +0200)]
Make "stg files" output match "quilt files" one

I'm used to doing vi $(quilt files), which is impossible with stgit.
Add an option (-b/--base) to request the normal behaviour, but make it
non-default as the current output is useful.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix "mail" command when description contains "From"
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:16 +0000 (21:35 +0200)]
Fix "mail" command when description contains "From"

For kernel patches, the "From" line from the email is often preserved in
the patch itself, and the one from the email is sometimes lost, so I add an
explicit one. And mail barfes on this.
Fix it up.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agostg diff / files: don't update directory cache
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:15 +0000 (21:35 +0200)]
stg diff / files: don't update directory cache

Do git-update-cache only when diffing with the working tree, not otherwise.
Spending something like 1min for a stg files is bad - yes, my laptop
was really busy and the Linux tree was probably cache-cold, but that's just
not needed.

Also, in diffstat we currently do it both by hand and by calling git.diff.
And in files there's no need at all for that - even the comments says that
"files" has only to do with committed changes.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoMake "empty patch" checking optional in "series"
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:13 +0000 (21:35 +0200)]
Make "empty patch" checking optional in "series"

That's just too slow, and quilt doesn't do it, so user will live with it.
Don't know if there's a reason to allow dropping the fanciness here
entirely, but I think there's no user doing one-liner scripts with quilt
series. And anyway, for that you can do "stg applied; stg unapplied".

Actually, with this patch you must ask explicitly the checking.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoIgnore the case on the PATCH name when importing
Catalin Marinas [Sat, 17 Sep 2005 07:53:58 +0000 (08:53 +0100)]
Ignore the case on the PATCH name when importing

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix typo: comitter->committer
Paolo 'Blaisorblade' Giarrusso [Fri, 16 Sep 2005 19:35:11 +0000 (21:35 +0200)]
Fix typo: comitter->committer

Found casually in commit.__init__, while profiling stg series.
And yes, I went checking that git has no typo.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoAllow 'import' to cherry-pick a commit object
Catalin Marinas [Fri, 16 Sep 2005 13:05:06 +0000 (14:05 +0100)]
Allow 'import' to cherry-pick a commit object

A commit object in the tree can be cherry-picked and imported into a
separate StGIT patch. It also allow reverse-importing, i.e. cancelling an
existing commit.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoPass -q to git-merge-cache
Catalin Marinas [Wed, 14 Sep 2005 14:38:02 +0000 (15:38 +0100)]
Pass -q to git-merge-cache

The error reporting is handled by gitmergeonefile.py

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years ago'export' will use patches-<branch> by default
Catalin Marinas [Wed, 14 Sep 2005 12:51:07 +0000 (13:51 +0100)]
'export' will use patches-<branch> by default

Previously, it was exporting to the patches directory by default but this
may cause problems if multiple branches are used.

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