chiark / gitweb /
stgit
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>
18 years agoUpdate 'stg pull' to the latest 'git pull' API
Catalin Marinas [Wed, 14 Sep 2005 12:31:23 +0000 (13:31 +0100)]
Update 'stg pull' to the latest 'git pull' API

The --head and --tag options are no longer available.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd --prefix example to INSTALL
Catalin Marinas [Tue, 13 Sep 2005 16:11:25 +0000 (17:11 +0100)]
Add --prefix example to INSTALL

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a --branch option to different commands
Catalin Marinas [Tue, 13 Sep 2005 16:11:18 +0000 (17:11 +0100)]
Add a --branch option to different commands

This command will show the information on a different branch than the
current one.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a --version=... option to the mail command
Catalin Marinas [Tue, 13 Sep 2005 09:44:58 +0000 (10:44 +0100)]
Add a --version=... option to the mail command

This option adds a version string in the [PATCH version nr/total] form for
the e-mailed patches.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoUse .git/info/exclude instead of .git/exclude
Catalin Marinas [Tue, 13 Sep 2005 09:28:38 +0000 (10:28 +0100)]
Use .git/info/exclude instead of .git/exclude

The stg status command should follow the latest GIT API.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a copyright command to display the copyright terms
Catalin Marinas [Wed, 7 Sep 2005 09:45:13 +0000 (10:45 +0100)]
Add a copyright command to display the copyright terms

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd a "version" command
Chuck Lever [Tue, 6 Sep 2005 16:12:29 +0000 (12:12 -0400)]
Add a "version" command

Flesh out existing version command and expose it.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years agoSet stg's text editor in .stgitrc
Chuck Lever [Tue, 6 Sep 2005 16:12:27 +0000 (12:12 -0400)]
Set stg's text editor in .stgitrc

Allow specifying stg's text editor in .stgitrc.  Some legacy tools need
an old version of "vi" in EDITOR, but we can be flexible.

Signed-off-by: Chuck Lever <cel@netapp.com>
18 years ago[PATCH] Allow fast-forward pushing.
Paolo 'Blaisorblade' Giarrusso [Fri, 2 Sep 2005 09:25:24 +0000 (11:25 +0200)]
[PATCH] Allow fast-forward pushing.

Pushing patches is too slow. It's a lot slower than quilt, and possibly
even slower than patch-scripts.

Especially, we never fast-forward patches even when we can, because when we
reorder patches that's not always safe.

It is safe to fast-forward a patch sequence if the first patch in the
sequence "chains" correctly with the current HEAD and each patch chains
with the previous one. With chaining I mean "HEAD commit id matches the
bottom id of the patch".

In this patch I fast-forward the longest possible sequence starting from
the first patch.

Since a single commit stores via parent links the entire history, after a
patch doesn't chain there's almost no need to try to chain other patches.

Actually it could maybe happen (but I'm not trying to exploit that case):
create a patch stack, pop it, apply a couple of subsequent patches out of
order (so it's reparented), pop it, and repush the stack in the old order.

The chained sequence will stop at the changed patch, but (should we reuse
the old commit id when repushing, and we can, provided we delete the .old
file when refreshing) we'd reapply again the same commits.

TODO: do fast-forward even when just the tree objects chain, but the
commits don't (for instance, after changing a patch description, we can't
fast-forward with this patch). We can do that with git-commit-tree, which
creates a new commit based on a given tree, parent, description, without
necessarily checking it out.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years ago[PATCH] Fix crash for empty description
Paolo 'Blaisorblade' Giarrusso [Fri, 2 Sep 2005 09:25:27 +0000 (11:25 +0200)]
[PATCH] Fix crash for empty description

We access the last character of the description, which may be empty. Use
slicing to avoid this crash.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years ago[PATCH] Support .gitignore
Paolo 'Blaisorblade' Giarrusso [Fri, 2 Sep 2005 09:25:17 +0000 (11:25 +0200)]
[PATCH] Support .gitignore

Add support in stgit for .git/exclude like cogito does. Additionally, add
-x option to avoid excluding any file from listing, as in cogito.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years ago[PATCH] Really fix import --edit invoking editor twice
Paolo 'Blaisorblade' Giarrusso [Fri, 2 Sep 2005 09:25:30 +0000 (11:25 +0200)]
[PATCH] Really fix import --edit invoking editor twice

A typo prevented the previous patch for this (commit
9d15ccd85e36ef5cd554aaf98f1c37ef0433697f) from working (edit is never used,
you should have set options.edit). Ah, nice Python! No var declarations and
these are the effects (yes, I reproduced this).

However, if the description is left empty, refresh_patch will again invoke
the editor. Also, with --showpatch, the first invocation shows the topmost
patch, not the one to be imported.

So better stop new_patch from invoking the editor, and call it only on
refresh.

Btw, clean the old unused "edit" parameter of Series.new_patch.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years ago[PATCH] Show patch content in description edit buffer
Paolo 'Blaisorblade' Giarrusso [Fri, 2 Sep 2005 09:25:20 +0000 (11:25 +0200)]
[PATCH] Show patch content in description edit buffer

Add an option (-s/--showpatch) to show the patch content when editing the
patch description, by appending it to the edit buffer, for more accurate
patch comment editing and to check its correctness before committing it.

It's how one works with quilt, and it's very important when the patch is
non-trivial to re-read it.

It's done for import, new and refresh, I left fold out.

Additionally, set the buffer filetype to "diff" for correct highlighting in
Vi.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
18 years agoFix push --undo to remove the local changes
Catalin Marinas [Wed, 24 Aug 2005 13:52:43 +0000 (14:52 +0100)]
Fix push --undo to remove the local changes

Without this patch, the command would fail if there are local changes
because of git-read-tree -m -u.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the import --edit function
Catalin Marinas [Tue, 23 Aug 2005 16:19:22 +0000 (17:19 +0100)]
Fix the import --edit function

If the patch doesn't have any description, the editor is invoked twice,
once by new_patch and the 2nd time by refresh_patch. This patch fixes
this issue.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise the merge operation
Catalin Marinas [Tue, 23 Aug 2005 15:44:14 +0000 (16:44 +0100)]
Optimise the merge operation

The merge operation performs unnecessary git-checkout-cache which was
already done by git-read-tree or gitmergeonefile.py. The refresh
resulted from a push operation should not check for the tree status
since the index is already up-to-date a successful merge. For an failed
merge, the commit is not performed anyway.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise the git.switch() function
Catalin Marinas [Tue, 23 Aug 2005 12:41:41 +0000 (13:41 +0100)]
Optimise the git.switch() function

By default it checks the tree status and checks out the given tree id.
This can be done with 'git-read-tree -m old new'.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoFix the push_patch function to not always call refresh_patch
Catalin Marinas [Tue, 23 Aug 2005 09:07:22 +0000 (10:07 +0100)]
Fix the push_patch function to not always call refresh_patch

The refresh_patch() function should only be called when there was a
merge operation, otherwise push_patch() should only checkout the new
head.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoRelease 0.6 v0.6
Catalin Marinas [Sun, 21 Aug 2005 07:55:25 +0000 (08:55 +0100)]
Release 0.6

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoVersion information changed to show 'Stacked GIT'
Catalin Marinas [Sun, 21 Aug 2005 07:54:08 +0000 (08:54 +0100)]
Version information changed to show 'Stacked GIT'

Previously, it was displaying 'stg'.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoMove the local search path at the beginning of sys.path
Catalin Marinas [Sun, 21 Aug 2005 07:48:13 +0000 (08:48 +0100)]
Move the local search path at the beginning of sys.path

This patch allows StGIT to search for the package files in the local
directories first, in order to avoid problems with multiple installations.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoREADME text moved to the wiki page
Catalin Marinas [Sun, 21 Aug 2005 07:00:34 +0000 (08:00 +0100)]
README text moved to the wiki page

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the 'id' command
Catalin Marinas [Thu, 18 Aug 2005 13:35:19 +0000 (14:35 +0100)]
Add the 'id' command

This command prints the hash value of a GIT id (defaulting to HEAD). In
addition to the standard GIT id's like heads and tags, this command also
accepts 'base' and '[<patch>]/(bottom | top)'.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoAdd the prefix information to INSTALL
Catalin Marinas [Thu, 18 Aug 2005 12:50:37 +0000 (13:50 +0100)]
Add the prefix information to INSTALL

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
18 years agoOptimise the Commit objects creation
Catalin Marinas [Thu, 18 Aug 2005 12:46:20 +0000 (13:46 +0100)]
Optimise the Commit objects creation

The Commit objects are used for commands like 'series' to check whether
a patch is empty or not. Since the bottom of a patch is usually the same
as the top of the previous one, it makes sense to cache the Commit
objects and reduce their creation (and git-cat-file calls) to half. This
patch adds a Commit objects factory which caches the results.

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