Code

git.git
12 years agoUse Test Harness
David A. Greene [Sun, 29 Jan 2012 22:09:58 +0000 (16:09 -0600)]
Use Test Harness

Clean up the git-subtree tests to conform the git project conventions
and use the existing test harness.

Signed-off-by: David A. Greene <greened@obbligato.org>
12 years agoRename Test
David A. Greene [Sun, 29 Jan 2012 22:09:15 +0000 (16:09 -0600)]
Rename Test

Rename the subtree test file to conform with git project conventions.

Signed-off-by: David A. Greene <greened@obbligato.org>
12 years agoMove Tests Into Subdirectory
David A. Greene [Sun, 29 Jan 2012 21:57:36 +0000 (15:57 -0600)]
Move Tests Into Subdirectory

Move the git-subtree tests into a "t" subdir to reflect how
testing works at the top level.

Signed-off-by: David A. Greene <greened@obbligato.org>
13 years agoSkip commit objects that should be trees, rather than copying them.
Avery Pennarun [Tue, 1 Mar 2011 04:48:50 +0000 (20:48 -0800)]
Skip commit objects that should be trees, rather than copying them.

An improvement on the previous patch, based on more reports from Sum-Wai
Low.

13 years agoIt's also okay if an expected tree object is actually a commit.
Avery Pennarun [Tue, 1 Mar 2011 00:49:42 +0000 (16:49 -0800)]
It's also okay if an expected tree object is actually a commit.

...that happens with submodules sometimes, so don't panic.

Reported by Sum-Wai Low.

14 years agoAdded check to order of processed commits.
Jesse Greenwald [Wed, 10 Nov 2010 04:18:36 +0000 (22:18 -0600)]
Added check to order of processed commits.

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.

14 years agoSplit cmd now processes commits in topo order.
Jesse Greenwald [Tue, 9 Nov 2010 14:34:49 +0000 (08:34 -0600)]
Split cmd now processes commits in topo order.

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.

14 years agoFix a few typos/grammar-o's in the preceding commit.
Avery Pennarun [Thu, 21 Oct 2010 19:28:18 +0000 (12:28 -0700)]
Fix a few typos/grammar-o's in the preceding commit.

14 years agodocs: Description, synopsys, options and examples changes.
John Yani [Thu, 12 Aug 2010 16:54:55 +0000 (19:54 +0300)]
docs: Description, synopsys, options and examples changes.

Description: Made the difference from submodules and the subtree
merge strategy clearer.

Synopsys and options: Synchronize with 'git subtree -h' output.
I hope, properly.

Examples: Added example descriptions in captions. Small fixes.

Signed-off-by: John Yani <vanuan@gmail.com>
14 years agoFixing eval syntax error.
Cole Stanfield [Mon, 13 Sep 2010 19:16:57 +0000 (13:16 -0600)]
Fixing eval syntax error.

14 years agoFix typo: an -> a
Avery Pennarun [Thu, 12 Aug 2010 15:15:57 +0000 (11:15 -0400)]
Fix typo: an -> a

Thanks to Vanuan on github.

14 years agodocs: simplify example 1
Bryan Larsen [Wed, 21 Jul 2010 16:58:05 +0000 (12:58 -0400)]
docs: simplify example 1

The documentation was written prior to Wayne Walter's 2-parameter add.
Using 2-parameter add in example 1 makes the example much simpler.

14 years agoAnother fix for PATH and msysgit.
Avery Pennarun [Thu, 24 Jun 2010 20:57:58 +0000 (16:57 -0400)]
Another fix for PATH and msysgit.

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.

14 years agoMerge remote branch 'origin/master'
Avery Pennarun [Thu, 24 Jun 2010 06:11:04 +0000 (02:11 -0400)]
Merge remote branch 'origin/master'

* origin/master:
  Fixed regression with splitting out new subtree
  Use 'git merge -Xsubtree' when git version >= 1.7.0.

14 years ago(Hopefully) fix PATH setting for msysgit.
Avery Pennarun [Thu, 24 Jun 2010 05:53:05 +0000 (01:53 -0400)]
(Hopefully) fix PATH setting for msysgit.

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.

14 years agoFixed regression with splitting out new subtree
Pelle Wessman [Thu, 20 May 2010 20:40:09 +0000 (22:40 +0200)]
Fixed regression with splitting out new subtree

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.

14 years agoUse 'git merge -Xsubtree' when git version >= 1.7.0.
Pelle Wessman [Fri, 7 May 2010 19:21:25 +0000 (21:21 +0200)]
Use 'git merge -Xsubtree' when git version >= 1.7.0.

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.

14 years agoAdded new 'push' command and 2-parameter form of 'add'.
Wayne Walter [Sat, 13 Feb 2010 19:32:21 +0000 (14:32 -0500)]
Added new 'push' command and 2-parameter form of 'add'.

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.)

14 years agoDocs: cleaning up example textual redundancy
Dan Sabath [Tue, 9 Feb 2010 01:43:09 +0000 (17:43 -0800)]
Docs: cleaning up example textual redundancy

Signed-off-by: Dan Sabath <dsabath@whitepages.com>
14 years agodocs: add simple 'add' case to clarify setup.
Dan Sabath [Tue, 9 Feb 2010 01:31:51 +0000 (20:31 -0500)]
docs: add simple 'add' case to clarify setup.

This patch adds a simple use case for adding a library to an existing
repository.

Signed-off-by: Dan Sabath <dsabath@whitepages.com>
14 years agoSome recent tests accidentally depended on very new versions of git.
Avery Pennarun [Tue, 9 Feb 2010 00:44:41 +0000 (19:44 -0500)]
Some recent tests accidentally depended on very new versions of git.

The "--format" option is too new.  Use "--pretty=format:" (which means the
same thing) instead.  Now it works again on git 1.6.0 (at least).

14 years agoOops. Apparently I didn't run 'make test' after most recent change.
Avery Pennarun [Tue, 9 Feb 2010 00:42:15 +0000 (19:42 -0500)]
Oops.  Apparently I didn't run 'make test' after most recent change.

Thanks to Dan Sabath for pointing that out.

14 years agoImprove checking for existence of the --prefix directory.
Avery Pennarun [Mon, 8 Feb 2010 20:00:42 +0000 (15:00 -0500)]
Improve checking for existence of the --prefix directory.

For add, the prefix must *not* already exist.  For all the other commands,
it *must* already exist.

14 years agoMake sure that <prefix> exists when splitting.
Win Treese [Sat, 6 Feb 2010 03:02:43 +0000 (22:02 -0500)]
Make sure that <prefix> exists when splitting.

And test cases for that check, as well as for an error if no prefix is
specified at all.

14 years agoMake tests pass with recent git (1.7.0 and up).
Avery Pennarun [Sat, 6 Feb 2010 20:05:17 +0000 (15:05 -0500)]
Make tests pass with recent git (1.7.0 and up).

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.

14 years agogit-subtree.txt: add another example.
Win Treese [Sat, 6 Feb 2010 00:48:11 +0000 (19:48 -0500)]
git-subtree.txt: add another example.

14 years agoJakub's changes broke the progress message slightly.
Avery Pennarun [Tue, 2 Feb 2010 15:30:11 +0000 (10:30 -0500)]
Jakub's changes broke the progress message slightly.

We really need that ^M (\r), not a ^J (\n) if we want the status message to
overwrite itself nicely.

14 years agoMerge branch 'master' of git://github.com/psionides/git-subtree
Avery Pennarun [Tue, 2 Feb 2010 15:25:58 +0000 (10:25 -0500)]
Merge branch 'master' of git://github.com/psionides/git-subtree

* '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

14 years agoFix refspecs in given example for git subtree pull.
Arlen Cuss [Tue, 19 Jan 2010 19:51:19 +0000 (12:51 -0700)]
Fix refspecs in given example for git subtree pull.

(Updated slightly by apenwarr)

14 years agoimproved rev_is_descendant_of_branch() function
Jakub Suder [Tue, 12 Jan 2010 22:34:52 +0000 (23:34 +0100)]
improved rev_is_descendant_of_branch() function

14 years agoadded temporary test dirs to gitignore
Jakub Suder [Tue, 12 Jan 2010 22:04:56 +0000 (23:04 +0100)]
added temporary test dirs to gitignore

14 years agoadded tests for recent changes
Jakub Suder [Tue, 12 Jan 2010 22:04:25 +0000 (23:04 +0100)]
added tests for recent changes

14 years agofixed bug in commit message for split
Jakub Suder [Tue, 12 Jan 2010 21:38:34 +0000 (22:38 +0100)]
fixed bug in commit message for split

14 years agochanged alias for --prefix from -p to -P
Jakub Suder [Tue, 12 Jan 2010 21:38:21 +0000 (22:38 +0100)]
changed alias for --prefix from -p to -P

14 years agofix for subtree split not finding proper base for new commits
Jakub Suder [Sat, 9 Jan 2010 22:01:39 +0000 (23:01 +0100)]
fix for subtree split not finding proper base for new commits

14 years agoallow using --branch with existing branches if it makes sense
Jakub Suder [Sat, 9 Jan 2010 18:56:05 +0000 (19:56 +0100)]
allow using --branch with existing branches if it makes sense

14 years agoadded -m/--message option for setting merge commit message
Jakub Suder [Sat, 9 Jan 2010 18:55:35 +0000 (19:55 +0100)]
added -m/--message option for setting merge commit message

14 years agoadded -p alias for --prefix
Jakub Suder [Wed, 6 Jan 2010 22:11:43 +0000 (23:11 +0100)]
added -p alias for --prefix

15 years agoWeird, I forgot to have 'make test' call test.sh.
Avery Pennarun [Sat, 21 Nov 2009 00:43:47 +0000 (19:43 -0500)]
Weird, I forgot to have 'make test' call test.sh.

15 years agomake git version dynamic when building documentation
Ben Walton [Sat, 14 Nov 2009 01:29:40 +0000 (20:29 -0500)]
make git version dynamic when building documentation

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
15 years agoadd installation support to Makefile
Ben Walton [Sat, 14 Nov 2009 01:29:39 +0000 (20:29 -0500)]
add installation support to Makefile

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
15 years agoOops, forgot a COPYING file. It's GPLv2.
Avery Pennarun [Sun, 15 Nov 2009 17:13:08 +0000 (12:13 -0500)]
Oops, forgot a COPYING file.  It's GPLv2.

Thanks to Ben Walton for pointing this out.

15 years agoAdd some tips for how to install.
Avery Pennarun [Wed, 4 Nov 2009 19:50:33 +0000 (14:50 -0500)]
Add some tips for how to install.

15 years agocmd_pull didn't support --squash correctly.
Avery Pennarun [Fri, 2 Oct 2009 22:23:54 +0000 (18:23 -0400)]
cmd_pull didn't support --squash correctly.

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.

15 years agoFix a minor problem in identifying squashes vs. normal splits.
Avery Pennarun [Fri, 2 Oct 2009 20:09:09 +0000 (16:09 -0400)]
Fix a minor problem in identifying squashes vs. normal splits.

This didn't seem to have any noticeable side effects other than
suspicious-looking log messages when you used -d.

15 years agoIf someone provides a --prefix that ends with slash, strip the slash.
Avery Pennarun [Fri, 2 Oct 2009 19:22:15 +0000 (15:22 -0400)]
If someone provides a --prefix that ends with slash, strip the slash.

Prefixes that differ only in the trailing slash should be considered
identical.

Also update the test to check that this works.

15 years agoMerge branch 'master' of git://github.com/voxpelli/git-subtree
Avery Pennarun [Fri, 2 Oct 2009 18:53:35 +0000 (14:53 -0400)]
Merge branch 'master' of git://github.com/voxpelli/git-subtree

* '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.

15 years agoAdd a README that says to email me instead of using github mail.
Avery Pennarun [Fri, 2 Oct 2009 15:51:25 +0000 (11:51 -0400)]
Add a README that says to email me instead of using github mail.

What's with this new generation who hates email so much?

15 years agoCheck that the type of the tree really is a tree and not a commit as it seems to...
Pelle Wessman [Wed, 30 Sep 2009 12:29:42 +0000 (14:29 +0200)]
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.

15 years agoFix behaviour if you have a branch named the same as your --prefix
Avery Pennarun [Wed, 26 Aug 2009 14:43:43 +0000 (10:43 -0400)]
Fix behaviour if you have a branch named the same as your --prefix

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.

15 years agoImprove patch to use git --exec-path: add to PATH instead.
Avery Pennarun [Wed, 26 Aug 2009 14:41:03 +0000 (10:41 -0400)]
Improve patch to use git --exec-path: add to PATH instead.

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.

15 years agoAdd explicit path of git installation by 'git --exec-path'.
kTln2 [Thu, 20 Aug 2009 11:30:45 +0000 (13:30 +0200)]
Add explicit path of git installation by 'git --exec-path'.

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>
15 years agosort assertion to make it more generic
Amiel Martin [Wed, 12 Aug 2009 22:38:00 +0000 (15:38 -0700)]
sort assertion to make it more generic

15 years agofixed order of assertion in tests
Amiel Martin [Wed, 12 Aug 2009 22:24:50 +0000 (15:24 -0700)]
fixed order of assertion in tests

15 years agotodo: idea for a 'git subtree grafts' command
Avery Pennarun [Sun, 2 Aug 2009 21:48:20 +0000 (17:48 -0400)]
todo: idea for a 'git subtree grafts' command

15 years agotodo
Avery Pennarun [Sat, 1 Aug 2009 05:19:48 +0000 (01:19 -0400)]
todo

15 years agotodo^
Avery Pennarun [Thu, 16 Jul 2009 18:31:50 +0000 (14:31 -0400)]
todo^

15 years agotodo
Avery Pennarun [Fri, 10 Jul 2009 19:14:33 +0000 (15:14 -0400)]
todo

15 years agoDocs: when pushing to github, the repo path needs to end in .git
Avery Pennarun [Thu, 9 Jul 2009 00:17:31 +0000 (20:17 -0400)]
Docs: when pushing to github, the repo path needs to end in .git

Reported by Thell Fowler.

15 years agotodo
Avery Pennarun [Tue, 7 Jul 2009 21:41:38 +0000 (17:41 -0400)]
todo

15 years agoSome todo items reported by pmccurdy
Avery Pennarun [Thu, 2 Jul 2009 16:39:48 +0000 (12:39 -0400)]
Some todo items reported by pmccurdy

15 years agoupdate todo
Avery Pennarun [Mon, 15 Jun 2009 18:12:40 +0000 (14:12 -0400)]
update todo

15 years agoman page: add an EXAMPLES section.
Avery Pennarun [Sat, 30 May 2009 18:24:31 +0000 (14:24 -0400)]
man page: add an EXAMPLES section.

15 years agoAdd basic git-subtree manpage in asciidoc format.
Avery Pennarun [Sat, 30 May 2009 18:05:33 +0000 (14:05 -0400)]
Add basic git-subtree manpage in asciidoc format.

15 years agoMake --squash work with the 'add' command too.
Avery Pennarun [Sat, 30 May 2009 08:11:43 +0000 (04:11 -0400)]
Make --squash work with the 'add' command too.

15 years agoFix splitting after using a squash merge.
Avery Pennarun [Sat, 30 May 2009 07:33:39 +0000 (03:33 -0400)]
Fix splitting after using a squash merge.

15 years agoDon't squash-merge if the old and new commits are the same.
Avery Pennarun [Sat, 30 May 2009 07:33:17 +0000 (03:33 -0400)]
Don't squash-merge if the old and new commits are the same.

15 years agoBasic "subtree merge --squash" support.
Avery Pennarun [Sat, 30 May 2009 07:18:27 +0000 (03:18 -0400)]
Basic "subtree merge --squash" support.

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.

15 years agomerge_msg() is really more like rejoin_msg().
Avery Pennarun [Sat, 30 May 2009 05:28:20 +0000 (01:28 -0400)]
merge_msg() is really more like rejoin_msg().

15 years agoFIXME help for --squash option
Avery Pennarun [Sat, 30 May 2009 04:48:07 +0000 (00:48 -0400)]
FIXME help for --squash option

15 years agoslightly rearrange help message for split.
Avery Pennarun [Sat, 30 May 2009 05:10:14 +0000 (01:10 -0400)]
slightly rearrange help message for split.

15 years agoNew --branch option to split command.
Avery Pennarun [Sat, 30 May 2009 05:05:43 +0000 (01:05 -0400)]
New --branch option to split command.

This is just a handy way to create a new branch from the newly-split subtree.

15 years agotypo in comment
Avery Pennarun [Sat, 30 May 2009 04:47:59 +0000 (00:47 -0400)]
typo in comment

15 years agoMore to-do items based on feedback
Avery Pennarun [Sun, 24 May 2009 19:28:54 +0000 (15:28 -0400)]
More to-do items based on feedback

15 years agoAbort if --rejoin fails.
Avery Pennarun [Fri, 1 May 2009 01:57:32 +0000 (21:57 -0400)]
Abort if --rejoin fails.

Thanks to Eduardo Kienetz for noticing this.

15 years agodebug messages are off by default; use -d to enable.
Avery Pennarun [Sun, 26 Apr 2009 22:06:08 +0000 (18:06 -0400)]
debug messages are off by default; use -d to enable.

Instead of debug messages, we print a progress counter to stderr.

15 years agotest.sh: oops, never intended to count the raw number of commits.
Avery Pennarun [Sun, 26 Apr 2009 22:05:49 +0000 (18:05 -0400)]
test.sh: oops, never intended to count the raw number of commits.

Just needed to make sure the count was non-zero.

15 years agoSimplify merges even more aggressively.
Avery Pennarun [Sun, 26 Apr 2009 21:44:18 +0000 (17:44 -0400)]
Simplify merges even more aggressively.

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.

15 years agotest.sh: make sure no commit changes more than one file at a time.
Avery Pennarun [Sun, 26 Apr 2009 21:43:53 +0000 (17:43 -0400)]
test.sh: make sure no commit changes more than one file at a time.

15 years agoOnly copy a commit if it has at least one nonidentical parent.
Avery Pennarun [Sun, 26 Apr 2009 21:07:16 +0000 (17:07 -0400)]
Only copy a commit if it has at least one nonidentical parent.

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.

15 years agoTrim some extra merge commits that don't need to go into the split tree.
Avery Pennarun [Sun, 26 Apr 2009 20:53:57 +0000 (16:53 -0400)]
Trim some extra merge commits that don't need to go into the split tree.

...and update test.sh to test for this.

15 years agotest.sh tweak
Avery Pennarun [Sun, 26 Apr 2009 20:33:38 +0000 (16:33 -0400)]
test.sh tweak

15 years agoAdd some basic assertions to test.sh.
Avery Pennarun [Sun, 26 Apr 2009 20:28:56 +0000 (16:28 -0400)]
Add some basic assertions to test.sh.

15 years agoAdd a 'create' helper function in test.sh.
Avery Pennarun [Sun, 26 Apr 2009 19:55:56 +0000 (15:55 -0400)]
Add a 'create' helper function in test.sh.

15 years agoClarify why we can't do 'git rev-list' with a path.
Avery Pennarun [Sun, 26 Apr 2009 19:54:42 +0000 (15:54 -0400)]
Clarify why we can't do 'git rev-list' with a path.

15 years agoTypo when searching for existing splits.
Avery Pennarun [Sun, 26 Apr 2009 13:55:59 +0000 (09:55 -0400)]
Typo when searching for existing splits.

15 years agoAdd --annotate option, and create recognizable file content during tests.
Avery Pennarun [Sun, 26 Apr 2009 12:59:12 +0000 (08:59 -0400)]
Add --annotate option, and create recognizable file content during tests.

15 years agotodo list
Avery Pennarun [Sun, 26 Apr 2009 12:53:14 +0000 (08:53 -0400)]
todo list

15 years agoChange test.sh to test the new add, merge, and pull commands.
Avery Pennarun [Sat, 25 Apr 2009 04:07:04 +0000 (00:07 -0400)]
Change test.sh to test the new add, merge, and pull commands.

15 years agoHandle it successfully if a given parent commit has no parents.
Avery Pennarun [Sat, 25 Apr 2009 04:06:45 +0000 (00:06 -0400)]
Handle it successfully if a given parent commit has no parents.

15 years agoAdd 'git subtree merge' and 'git subtree pull'.
Avery Pennarun [Sat, 25 Apr 2009 03:41:19 +0000 (23:41 -0400)]
Add 'git subtree merge' and 'git subtree pull'.

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.

15 years agoAdd a new 'git subtree add' command for adding subtrees from a given rev.
Avery Pennarun [Sat, 25 Apr 2009 03:28:30 +0000 (23:28 -0400)]
Add a new 'git subtree add' command for adding subtrees from a given rev.

15 years agoPass the path using the --prefix option instead of on the command line.
Avery Pennarun [Sat, 25 Apr 2009 02:57:14 +0000 (22:57 -0400)]
Pass the path using the --prefix option instead of on the command line.

I like this better.  It's more like git-read-tree and some other commands.

15 years agoOkay, that was a little too aggressive.
Avery Pennarun [Sat, 25 Apr 2009 02:36:06 +0000 (22:36 -0400)]
Okay, that was a little too aggressive.

Now we only prune out a commit if it has exactly one remaining parent and
that parent's tree is identical to ours.

But I also changed the test to create the initial "-s ours" merge in one
step instead of two, and that merge can be eliminated since one of its
parents doesn't affect the subdir at all, and is thus deleted.

15 years agoEven more aggressive commit trimming.
Avery Pennarun [Sat, 25 Apr 2009 02:05:30 +0000 (22:05 -0400)]
Even more aggressive commit trimming.

Now we cut out a commit if any of its parents had the same tree; just use
that parent in its place.  This makes the history look nice, but I don't
think it's quite right...

15 years agoPrune out some extra merge commits by comparing their parents correctly.
Avery Pennarun [Sat, 25 Apr 2009 01:49:19 +0000 (21:49 -0400)]
Prune out some extra merge commits by comparing their parents correctly.

15 years agoQuick test script for generating reasonably complex merge scenarios.
Avery Pennarun [Sat, 25 Apr 2009 01:35:50 +0000 (21:35 -0400)]
Quick test script for generating reasonably complex merge scenarios.

15 years agoSkip over empty commits.
Avery Pennarun [Fri, 24 Apr 2009 21:53:10 +0000 (17:53 -0400)]
Skip over empty commits.

But we still need to get rid of unnecessary merge commits somehow...

15 years agoHmm... can't actually filter rev-list on the subdir name.
Avery Pennarun [Fri, 24 Apr 2009 21:42:33 +0000 (17:42 -0400)]
Hmm... can't actually filter rev-list on the subdir name.

Otherwise we can't keep track of parent relationships.  Argh.

This change makes it "work", but we get a bunch of empty commits.

15 years agoAdded a --onto option, but it's so complicated I can't tell if it works.
Avery Pennarun [Fri, 24 Apr 2009 21:05:14 +0000 (17:05 -0400)]
Added a --onto option, but it's so complicated I can't tell if it works.