summaryrefslogtreecommitdiff
path: root/git-subtree.sh
AgeCommit message (Collapse)AuthorFilesLines
2011-02-28Skip commit objects that should be trees, rather than copying them.Libravatar Avery Pennarun1-0/+1
An improvement on the previous patch, based on more reports from Sum-Wai Low.
2011-02-28It's also okay if an expected tree object is actually a commit.Libravatar Avery Pennarun1-1/+1
...that happens with submodules sometimes, so don't panic. Reported by Sum-Wai Low.
2010-11-09Added check to order of processed commits.Libravatar Jesse Greenwald1-0/+28
With debug messages enabled, "incorrect order" will be output whenever a commit is processed before its parents have been processed. This can be determined by checking to see if a parent isn't mapped to a new commit, but it has been processed.
2010-11-09Split cmd now processes commits in topo order.Libravatar Jesse Greenwald1-1/+1
Added the "--topo-order" option to git rev-list. Without this, it seems that the revision list is coming back in reverse order but it is sorted chronologically. This does not gurantee that parent commits are handled before child commits.
2010-10-21Fixing eval syntax error.Libravatar Cole Stanfield1-1/+1
2010-06-24Another fix for PATH and msysgit.Libravatar Avery Pennarun1-3/+1
Evan Shaw tells me the previous fix didn't work. Let's use this one instead, which he says does work. This fix is kind of wrong because it will run the "correct" git-sh-setup *after* the one in /usr/bin, if there is one, which could be weird if you have multiple versions of git installed. But it works on my Linux and his msysgit, so it's obviously better than what we had before.
2010-06-24Merge remote branch 'origin/master'Libravatar Avery Pennarun1-5/+17
* origin/master: Fixed regression with splitting out new subtree Use 'git merge -Xsubtree' when git version >= 1.7.0.
2010-06-24(Hopefully) fix PATH setting for msysgit.Libravatar Avery Pennarun1-0/+4
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.
2010-05-20Fixed regression with splitting out new subtreeLibravatar Pelle Wessman1-1/+4
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.
2010-05-07Use 'git merge -Xsubtree' when git version >= 1.7.0.Libravatar Pelle Wessman1-4/+13
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.
2010-02-13Added new 'push' command and 2-parameter form of 'add'.Libravatar Wayne Walter1-9/+49
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.)
2010-02-08Improve checking for existence of the --prefix directory.Libravatar Avery Pennarun1-3/+6
For add, the prefix must *not* already exist. For all the other commands, it *must* already exist.
2010-02-06Make sure that <prefix> exists when splitting.Libravatar Win Treese1-0/+5
And test cases for that check, as well as for an error if no prefix is specified at all.
2010-02-06Make tests pass with recent git (1.7.0 and up).Libravatar Avery Pennarun1-1/+5
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.
2010-02-02Jakub's changes broke the progress message slightly.Libravatar Avery Pennarun1-2/+1
We really need that ^M (\r), not a ^J (\n) if we want the status message to overwrite itself nicely.
2010-01-12improved rev_is_descendant_of_branch() functionLibravatar Jakub Suder1-2/+2
2010-01-12fixed bug in commit message for splitLibravatar Jakub Suder1-1/+1
2010-01-12changed alias for --prefix from -p to -PLibravatar Jakub Suder1-2/+2
2010-01-10fix for subtree split not finding proper base for new commitsLibravatar Jakub Suder1-1/+4
2010-01-10allow using --branch with existing branches if it makes senseLibravatar Jakub Suder1-8/+26
2010-01-10added -m/--message option for setting merge commit messageLibravatar Jakub Suder1-4/+26
2010-01-06added -p alias for --prefixLibravatar Jakub Suder1-2/+2
2009-10-02cmd_pull didn't support --squash correctly.Libravatar Avery Pennarun1-2/+3
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.
2009-10-02Fix a minor problem in identifying squashes vs. normal splits.Libravatar Avery Pennarun1-1/+3
This didn't seem to have any noticeable side effects other than suspicious-looking log messages when you used -d.
2009-10-02If someone provides a --prefix that ends with slash, strip the slash.Libravatar Avery Pennarun1-3/+3
Prefixes that differ only in the trailing slash should be considered identical. Also update the test to check that this works.
2009-09-30Check that the type of the tree really is a tree and not a commit as it ↵Libravatar Pelle Wessman1-0/+1
seems to sometimes become when eg. a submodule has existed in the same position previously.
2009-08-26Fix behaviour if you have a branch named the same as your --prefixLibravatar Avery Pennarun1-1/+1
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.
2009-08-26Improve patch to use git --exec-path: add to PATH instead.Libravatar Avery Pennarun1-1/+2
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.
2009-08-20Add explicit path of git installation by 'git --exec-path'.Libravatar kTln21-1/+1
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>
2009-05-30Make --squash work with the 'add' command too.Libravatar Avery Pennarun1-18/+39
2009-05-30Fix splitting after using a squash merge.Libravatar Avery Pennarun1-2/+6
2009-05-30Don't squash-merge if the old and new commits are the same.Libravatar Avery Pennarun1-0/+4
2009-05-30Basic "subtree merge --squash" support.Libravatar Avery Pennarun1-1/+77
Instead of merging in the history of the entire subproject, just squash it all into one commit, but try to at least track which commits we used so that we can do future merges correctly. Bonus feature: we can actually switch branches of the subproject this way, just by "squash merging" back and forth from one tag to another.
2009-05-30merge_msg() is really more like rejoin_msg().Libravatar Avery Pennarun1-5/+8
2009-05-30FIXME help for --squash optionLibravatar Avery Pennarun1-0/+5
2009-05-30slightly rearrange help message for split.Libravatar Avery Pennarun1-2/+2
2009-05-30New --branch option to split command.Libravatar Avery Pennarun1-2/+24
This is just a handy way to create a new branch from the newly-split subtree.
2009-05-30typo in commentLibravatar Avery Pennarun1-1/+1
2009-04-30Abort if --rejoin fails.Libravatar Avery Pennarun1-1/+1
Thanks to Eduardo Kienetz for noticing this.
2009-04-26debug messages are off by default; use -d to enable.Libravatar Avery Pennarun1-2/+18
Instead of debug messages, we print a progress counter to stderr.
2009-04-26Simplify merges even more aggressively.Libravatar Avery Pennarun1-1/+1
If any one of the parents is the same as the current one, then clearly the other parent branch isn't important, so throw it away entirely. Can't remember why I didn't do this before, but if I rediscover it, it definitely needs a unit test.
2009-04-26Only copy a commit if it has at least one nonidentical parent.Libravatar Avery Pennarun1-1/+4
This is a simplification of the previous logic. I don't *think* it'll break anything. Results in far fewer useless merge commmits when playing with gitweb in the git project: git subtree split --prefix=gitweb --annotate='(split) ' 0a8f4f0^^..f2e7330 --onto=1130ef3 ...and it doesn't *seem* to eliminate anything important.
2009-04-26Trim some extra merge commits that don't need to go into the split tree.Libravatar Avery Pennarun1-3/+16
...and update test.sh to test for this.
2009-04-26Clarify why we can't do 'git rev-list' with a path.Libravatar Avery Pennarun1-3/+3
2009-04-26Typo when searching for existing splits.Libravatar Avery Pennarun1-1/+1
2009-04-26Add --annotate option, and create recognizable file content during tests.Libravatar Avery Pennarun1-1/+5
2009-04-25Handle it successfully if a given parent commit has no parents.Libravatar Avery Pennarun1-1/+12
2009-04-24Add 'git subtree merge' and 'git subtree pull'.Libravatar Avery Pennarun1-15/+40
These are simple shortcuts for 'git merge -s subtree' and 'git pull -s subtree', but it makes sense to have it all in one command.
2009-04-24Add a new 'git subtree add' command for adding subtrees from a given rev.Libravatar Avery Pennarun1-3/+53
2009-04-24Pass the path using the --prefix option instead of on the command line.Libravatar Avery Pennarun1-12/+16
I like this better. It's more like git-read-tree and some other commands.