Reported by Evan Shaw. The problem is that $(git --exec-path) includes a
'git' binary which is incompatible with the one in /usr/bin; if you run it,
it gives you an error about libiconv2.dll.
You might think we could just add $(git --exec-path) at the *end* of PATH,
but then if there are multiple versions of git installed, we could end up
with the wrong one; earlier versions used to put git-sh-setup in /usr/bin,
so we'd pick up that one before the new one.
So now we just set PATH back to its original value right after running
git-sh-setup, and we should be okay.
A folder in a repository that wasn't initially imported as a subtree could no longer be splitted into an entirely new subtree with no parent.
A fix and a new test to fix that regression is added here.
It's possible to specify the subdir of a subtree since Git 1.7.0 - adding
support for that functionality to make the merge more stable.
Also checking for git version - now only uses the new subtree subdir option
when on at least 1.7.
Now you can do:
git subtree add --prefix=whatever git://wherever branchname
to add a new branch, instead of rather weirdly having to do 'git fetch'
first. You can also split and push in one step:
git subtree push --prefix=whatever git://wherever newbranch
(Somewhat cleaned up by apenwarr.)
It seems that in older versions, --message="" was interpreted as "use the
default commit message" instead of "use an empty commit message", and
git-subtree was depending on this behaviour. Now we don't, so tests pass
again.
* 'master' of git://github.com/psionides/git-subtree:
improved rev_is_descendant_of_branch() function
added temporary test dirs to gitignore
added tests for recent changes
fixed bug in commit message for split
changed alias for --prefix from -p to -P
fix for subtree split not finding proper base for new commits
allow using --branch with existing branches if it makes sense
added -m/--message option for setting merge commit message
added -p alias for --prefix
We should implement it as
git fetch ...
git subtree merge ...
But we were instead just calling
git pull -s subtree ...
because 'git subtree merge' used to be just an alias for 'git merge -s
subtree', but it no longer is.
* 'master' of git://github.com/voxpelli/git-subtree:
Check that the type of the tree really is a tree and not a commit as it seems to sometimes become when eg. a submodule has existed in the same position previously.
We were trying to 'git checkout $prefix', which is ambiguous if $prefix
names a directory *and* a branch. Do 'git checkout -- $prefix' instead.
The main place this appeared was in 'git subtree add'.
Reported by several people.
If you (like me) are using a modified git straight out of its source
directory (ie. without installing), then --exec-path isn't actually correct.
Add it to the PATH instead, so if it is correct, it'll work, but if it's
not, we fall back to the previous behaviour.
As pointed out by documentation, the correct use of 'git-sh-setup' is
using $(git --exec-path) to avoid problems with not standard
installations.
Signed-off-by: gianluca.pacchiella <pacchiel@studenti.ph.unito.it>