Read several objects at once with git cat-file --batch

Instead of spawning a separate cat-file process for every blob and
commit we want to read. This speeds things up slightly: about 6-8%
when uncommitting and rebasing 1470 linux-kernel patches (perftest.py
rebase-newrebase-add-file-linux).

Signed-off-by: Karl Wiberg <kha@treskal.com>
get_merge_bases() should return a list rather than set

This is for cases where we need to use one of the elements of the list.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Allow uncommitting to a common ancestor

With the --to=<commit> option to uncommit, if the given commit is not in
the history just try to find the common ancestor and uncommit to that
point (exclusive range).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Do not truncate the last word when creating patch names

The automatically generated patch names are truncated to
stgit.namelength but this was truncating the final words.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Fix stg repair for hidden patches

Signed-off-by: Juergen Wieferink <wieferink@fhi-berlin.mpg.de>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Add a branch --cleanup option

This has been required for some time. If you need to take a branch out
of StGit control, use this option (keeps the branch but removes the
metadata).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
StGit: export: fix base commit reporting in series file

This bug was introduced in 3f19450c426970b78b19c522a82df1a962da5761
It should report the commit stg stack is based on, but not the
last patch in stack.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
contrib/vim: Add vim syntax highlighting for StGit commit messages

Signed-off-by: Zane Bitter <zane.bitter@alliedtelesis.co.nz>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Remove the assert in CommitData.parse() function

When some unknown key/value pairs are found in the commit data, StGit
crashes. It looks like this can actually happen with the "encoding:
latin1" pair.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Diff several trees at once with git diff-tree --stdin

Instead of spawning a separate diff-tree process for every pair of
trees we want to diff. This speeds things up slightly: about 10% when
uncommitting and rebasing 1470 linux-kernel patches (perftest.py
rebase-newrebase-add-file-linux).

Signed-off-by: Karl Wiberg <kha@treskal.com>
Correct function docstring

Signed-off-by: Karl Wiberg <kha@treskal.com>
reorder_patches: Comment that a failed push means we never get to the end

Signed-off-by: Karl Wiberg <kha@treskal.com>
Add two tests (one currently failing) for "stg float" causing conflicts

Signed-off-by: Karl Wiberg <kha@treskal.com>
Don't clear the list of changed patches when we hit a push conflict

This fixes the failing test added in the previous patch. Bug
discovered by and fixed in collaboration with Dan Härdfeldt.

The offending line was added in

  ba52890d Record a single transaction for conflicting push operations

but I can't see why.

Signed-off-by: Karl Wiberg <kha@treskal.com>
fix typo in examples/gitconfig

Signed-off-by: Lu Guanqun <guanqun.lu@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
add color to series command

The ANSI escape sequence chart is got from http://pypi.python.org/pypi/colorama

The example file is updated as well to show how to specify the colors.

Signed-off-by: Lu Guanqun <guanqun.lu@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
add fuzzy patch name lookup support for 'goto' command

With this patch, we can now specify part of a long patch name, and it will try
to match the correct one.

Signed-off-by: Lu Guanqun <guanqun.lu@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
remove obseleted TODO item

This TODO item was done with this commit, so remove it.

c6f366f6b7452e24edf5bff06da8b69c500899a4
Author: Catalin Marinas <catalin.marinas@gmail.com>
Date:   Fri Jan 26 22:29:10 2007 +0000

    Make the 'series --short' length configurable

    The 'shortnr' config option was added so that one can set a different
    length than the default 5.

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

Signed-off-by: Lu Guanqun <guanqun.lu@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Allow 'stg reset --hard' to reset the changes in the worktree

This is similar to the git reset --hard command.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Replace the 'stg status' command with the 'git status -s' alias

There isn't really any point in keeping another status command. The only
functionality missing would be 'status --reset' but this was moved to
the 'reset --hard' command (similar to what Git does).

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