summaryrefslogtreecommitdiff
path: root/contrib/subtree
AgeCommit message (Collapse)Author
2020-08-24Merge branch 'dl/subtree-docs'Junio C Hamano
Doc updates for subtree (in contrib/) * dl/subtree-docs: contrib/subtree: document 'push' does not take '--squash' contrib/subtree: fix "unsure" for --message in the document
2020-08-18contrib/subtree: document 'push' does not take '--squash'Danny Lin
git subtree push does not support --squash, as previously illustrated in 6ccc71a9 (contrib/subtree: there's no push --squash, 2015-05-07) Signed-off-by: Danny Lin <danny0838@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-18contrib/subtree: fix "unsure" for --message in the documentDanny Lin
Revise the documentation and remove previous "unsure" after making sure that --message supports only 'add', 'merge', 'pull', and 'split --rejoin'. Signed-off-by: Danny Lin <danny0838@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-03Revert "contrib: subtree: adjust test to change in fmt-merge-msg"Emily Shaffer
This reverts commit 508fd8e8baf3e18ee40b2cf0b8899188a8506d07. In 6e6029a8 (fmt-merge-msg: allow merge destination to be omitted again) we get back the behavior where merges against 'master', by default, do not include "into 'master'" at the end of the merge message. This test fix is no longer needed. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-30contrib: subtree: adjust test to change in fmt-merge-msgĐoàn Trần Công Danh
We're starting to stop treating `master' specially in fmt-merge-msg. Adjust the test to reflect that change. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-04-08subtree: fix build with AsciiDoctor 2Johannes Schindelin
This is a (late) companion for f6461b82b93 (Documentation: fix build with Asciidoctor 2, 2019-09-15). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-12contrib/subtree: ensure only one rev is providedDenton Liu
While looking at the inline help for git-subtree.sh, I noticed that git subtree split --prefix=<prefix> <commit...> was given as an option. However, it only really makes sense to provide one revision because of the way the commits are forwarded to rev-parse so change "<commit...>" to "<commit>" to reflect this. In addition, check the arguments to ensure that only one rev is provided for all subcommands that accept a commit. Signed-off-by: Denton Liu <liu.denton@gmail.com> Acked-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-30Merge branch 'ch/subtree-build'Junio C Hamano
Build update for "git subtree" (in contrib/) documentation pages. * ch/subtree-build: Revert "subtree: make install targets depend on build targets" subtree: make install targets depend on build targets subtree: add build targets 'man' and 'html'
2018-10-18Revert "subtree: make install targets depend on build targets"Junio C Hamano
This reverts commit 744f7c4c314dc0e7816ac05520e8358c8318187a. These targets do depend on the fact that each prereq is explicitly listed via their use of $^, which I failed to notice, and broke the build.
2018-10-16subtree: make install targets depend on build targetsChristian Hesse
Now that we have build targets let the install targets depend on them. Also make the targets phony. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-12subtree: performance improvement for finding unexpected parent commitsRoger Strain
After testing a previous patch at larger scale, a performance issue was detected when using git show to locate parent revisions, with a single run of the git show command taking 2 seconds or longer in a complex repo. When the command is required tens or hundreds of times in a run of the script, the additional wait time is unaccepatable. Replacing the command with git rev-parse resulted in significantly increased performance, with the command in question returning instantly. Signed-off-by: Roger Strain <rstrain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-10subtree: add build targets 'man' and 'html'Christian Hesse
We have targets 'install-man' and 'install-html', let's add build targets as well. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-06subtree: improve decision on merges kept in splitStrain, Roger L
When multiple identical parents are detected for a commit being considered for copying, explicitly check whether one is the common merge base between the commits. If so, the other commit can be used as the identical parent; if not, a merge must be performed to maintain history. In some situations two parents of a merge commit may appear to both have identical subtree content with each other and the current commit. However, those parents can potentially come from different commit graphs. Previous behavior would simply select one of the identical parents to serve as the replacement for this commit, based on the order in which they were processed. New behavior compares the merge base between the commits to determine if a new merge commit is necessary to maintain history despite the identical content. Signed-off-by: Strain, Roger L <roger.strain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-06subtree: use commits before rejoins for splitsStrain, Roger L
Adds recursive evaluation of parent commits which were not part of the initial commit list when performing a split. Split expects all relevant commits to be reachable from the target commit but not reachable from any previous rejoins. However, a branch could be based on a commit prior to a rejoin, then later merged back into the current code. In this case, a parent to the commit will not be present in the initial list of commits, trigging an "incorrect order" warning. Previous behavior was to consider that commit to have no parent, creating an original commit containing all subtree content. This commit is not present in an existing subtree commit graph, changing commit hashes and making pushing to a subtree repo impossible. New behavior will recursively check these unexpected parent commits to track them back to either an earlier rejoin, or a true original commit. The generated synthetic commits will properly match previously-generated commits, allowing successful pushing to a prior subtree repo. Signed-off-by: Strain, Roger L <roger.strain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-06subtree: make --ignore-joins pay attention to addsStrain, Roger L
Changes the behavior of --ignore-joins to always consider a subtree add commit, and ignore only splits and squashes. The --ignore-joins option is documented to ignore prior --rejoin commits. However, it additionally ignored subtree add commits generated when a subtree was initially added to a repo. Due to the logic which determines whether a commit is a mainline commit or a subtree commit (namely, the presence or absence of content in the subtree prefix) this causes commits before the initial add to appear to be part of the subtree. An --ignore-joins split would therefore consider those commits part of the subtree history and include them at the beginning of the synthetic history, causing the resulting hashes to be incorrect for all later commits. Signed-off-by: Strain, Roger L <roger.strain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-06subtree: refactor split of a commit into standalone methodStrain, Roger L
In a particularly complex repo, subtree split was not creating compatible splits for pushing back to a separate repo. Addressing one of the issues requires recursive handling of parent commits that were not initially considered by the algorithm. This commit makes no functional changes, but relocates the code to be called recursively into a new method to simply comparisons of later commits. Signed-off-by: Strain, Roger L <roger.strain@swri.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-30subtree test: simplify preparation of expected resultsJonathan Nieder
This mixture of quoting, pipes, and here-docs to produce expected results in shell variables is difficult to follow. Simplify by using simpler constructs that write output to files instead. Noticed because without this patch, t/chainlint is not able to understand the script in order to validate that its subshells use an unbroken &&-chain, causing "make -C contrib/subtree test" to fail with error: bug in the test script: broken &&-chain or run-away HERE-DOC: in t7900.21. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-30subtree test: add missing && to &&-chainJonathan Nieder
Detected using t/chainlint. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-03-08Merge branch 'sg/subtree-signed-commits'Junio C Hamano
"git subtree" script (in contrib/) scripted around "git log", whose output got affected by end-user configuration like log.showsignature * sg/subtree-signed-commits: subtree: fix add and pull for GPG-signed commits
2018-02-23subtree: fix add and pull for GPG-signed commitsStephen R Guglielmo
If log.showsignature is true (or --show-signature is passed) while performing a `subtree add` or `subtree pull`, the command fails. toptree_for_commit() calls `log` and passes the output to `commit-tree`. If this output shows the GPG signature data, `commit-tree` throws a fatal error. This commit fixes the issue by adding --no-show-signature to `log` calls in a few places, as well as using the more appropriate `rev-parse` instead where possible. Signed-off-by: Stephen R Guglielmo <srg@guglielmo.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-02-14Correct mispellings of ".gitmodule" to ".gitmodules"Robert P. J. Day
There are a small number of misspellings, ".gitmodule", scattered throughout the code base, correct them ... no apparent functional changes. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-23treewide: correct several "up-to-date" to "up to date"Martin Ågren
Follow the Oxford style, which says to use "up-to-date" before the noun, but "up to date" after it. Don't change plumbing (specifically send-pack.c, but transport.c (git push) also has the same string). This was produced by grepping for "up-to-date" and "up to date". It turned out we only had to edit in one direction, removing the hyphens. Fix a typo in Documentation/git-diff-index.txt while we're there. Reported-by: Jeffrey Manian <jeffrey.manian@gmail.com> Reported-by: STEVEN WHITE <stevencharleswhitevoices@gmail.com> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-28subtree: honour USE_ASCIIDOCTOR when setA. Wilcox
Defining USE_ASCIIDOCTOR=1 when building Git uses asciidoctor over asciidoc when generating DocBook and man page documentation. However, the contrib/subtree module does not presently honour that flag. This causes a build failure when asciidoc is not present on the build system. Instead, adapt the main Documentation/Makefile logic to use asciidoctor when requested. Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-11Spelling fixesVille Skyttä
<BAD> <CORRECTED> accidently accidentally commited committed dependancy dependency emtpy empty existance existence explicitely explicitly git-upload-achive git-upload-archive hierachy hierarchy indegee indegree intial initial mulitple multiple non-existant non-existent precendence. precedence. priviledged privileged programatically programmatically psuedo-binary pseudo-binary soemwhere somewhere successfull successful transfering transferring uncommited uncommitted unkown unknown usefull useful writting writing Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-28subtree: adjust function definitions to match CodingGuidelinesDavid Aguilar
We prefer a space between the function name and the parentheses, and no space inside the parentheses. The opening "{" should also be on the same line. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-28subtree: adjust style to match CodingGuidelinesDavid Aguilar
Prefer "test" over "[ ... ]", use double-quotes around variables, break long lines, and properly indent "case" statements. Helped-by: Johannes Sixt <j6t@kdbg.org> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-26subtree: fix "git subtree split --rejoin"David Aguilar
"git merge" in v2.9 prevents merging unrelated histories. "git subtree split --rejoin" creates unrelated histories when creating a split repo from a raw sub-directory that did not originate from an invocation of "git subtree add". Restore the original behavior by passing --allow-unrelated-histories when merging subtrees. This ensures that the synthetic history created by "git subtree split" can be merged. Add a test to ensure that this feature works as advertised. Reported-by: Brett Cundal <brett.cundal@iugome.com> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-26t7900-subtree.sh: fix quoting and broken && chainsDavid Aguilar
Allow whitespace in arguments to subtree_test_create_repo. Add missing && chains. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-03Merge branch 'dw/subtree-split-do-not-drop-merge'Junio C Hamano
The "split" subcommand of "git subtree" (in contrib/) incorrectly skipped merges when it shouldn't, which was corrected. * dw/subtree-split-do-not-drop-merge: contrib/subtree: fix "subtree split" skipped-merge bug
2016-02-03Merge branch 'dg/subtree-test'Junio C Hamano
* dg/subtree-test: contrib/subtree: Make testing easier
2016-01-22Merge branch 'rm/subtree-unwrap-tags'Junio C Hamano
"git subtree" (in contrib/) records the tag object name in the commit log message when a subtree is added using a tag, without peeling it down to the underlying commit. The tag needs to be peeled when "git subtree split" wants to work on the commit, but the command forgot to do so. * rm/subtree-unwrap-tags: contrib/subtree: unwrap tag refs
2016-01-20contrib/subtree: fix "subtree split" skipped-merge bugDave Ware
'git subtree split' can incorrectly skip a merge even when both parents act on the subtree, provided the merge results in a tree identical to one of the parents. Fix by copying the merge if at least one parent is non-identical, and the non-identical parent is not an ancestor of the identical parent. Also, add a test case which checks that a descendant remains a descendent on the subtree in this case. Signed-off-by: Dave Ware <davidw@realtimegenomics.com> Reviewed-by: David A. Greene <greened@obbligato.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-19contrib/subtree: Make testing easierDavid A. Greene
Add some Makefile dependencies to ensure an updated git-subtree gets copied to the main area before testing begins. Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-01Merge branch 'dg/subtree-test-cleanup'Jeff King
Test cleanups for the subtree project. * dg/subtree-test-cleanup: contrib/subtree: Handle '--prefix' argument with a slash appended contrib/subtree: Make each test self-contained contrib/subtree: Add split tests contrib/subtree: Add merge tests contrib/subtree: Add tests for subtree add contrib/subtree: Add test for missing subtree contrib/subtree: Clean and refactor test code
2015-11-24contrib/subtree: unwrap tag refsRob Mayoff
If a subtree was added using a tag ref, the tag ref is stored in the subtree commit message instead of the underlying commit's ref. To split or push subsequent changes to the subtree, the subtree command needs to unwrap the tag ref. This patch makes it do so. The problem was described in a message to the mailing list from Junio C Hamano dated 29 Apr 2014, with the subject "Re: git subtree issue in more recent versions". The archived message can be found at <http://comments.gmane.org/gmane.comp.version-control.git/247503>. Signed-off-by: Rob Mayoff <mayoff@dqd.com> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Handle '--prefix' argument with a slash appendedTechlive Zheng
'git subtree merge' will fail if the argument of '--prefix' has a slash appended. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Make each test self-containedTechlive Zheng
Each test runs a full repository creation and any subtree actions needed to perform the test. Each test starts with a clean slate, making debugging and post-mortem analysis much easier. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add split testsTechlive Zheng
Add tests to check various options to split. Check combinations of --prefix, --message, --annotate, --branch and --rejoin. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add merge testsTechlive Zheng
Add some tests for various merge operations. Test combinations of merge with --message, --prefix and --squash. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add tests for subtree addTechlive Zheng
Add some tests to check various options to subtree add. These test various combinations of --message, --prefix and --squash. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add test for missing subtreeTechlive Zheng
Test that a merge from a non-existant subtree fails. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Clean and refactor test codeTechlive Zheng
Mostly prepare for the later tests refactoring. This moves some common code to helper functions and generally cleans things up to be more presentable. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-06contrib/subtree: remove "push" command from the "todo" fileFabio Porcedda
Because the "push" command is already available, remove it from the "todo" file. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-08contrib/subtree: respect spaces in a repository pathAlexey Shumkin
Remote repository may have spaces in its path, so take it into account. Also, as far as there are no tests for the `push` command, add them. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-08t7900-subtree: test the "space in a subdirectory name" caseAlexey Shumkin
In common case there can be spaces in a subdirectory name. Change tests accorgingly to this statement. Also, as far as a call to the `rejoin_msg` function (in `cmd_split`) does not take into account such a case this patch fixes commit message when `--rejoin` option is set . Besides, as `fixnl` and `multiline` functions did not take into account the "new" tested "space in a subdirectory name" case they become unused and redundant, so they are removed. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-03Merge branch 'da/subtree-date-confusion'Junio C Hamano
"git subtree" (in contrib/) depended on "git log" output to be stable, which was a no-no. Apply a workaround to force a particular date format. * da/subtree-date-confusion: contrib/subtree: ignore log.date configuration
2015-07-23contrib/subtree: ignore log.date configurationDavid Aguilar
git-subtree's log format string uses "%ad" and "%cd", which respect the user's configured log.date value. This is problematic for git-subtree because it needs to use real dates so that copied commits come through unchanged. Add a test and tweak the format strings to use %aD and %cD so that the default date format is used instead. Reported-by: Bryan Jacobs <b@q3q.us> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-10Merge branch 'cb/subtree-tests-update'Junio C Hamano
Tests update in contrib/subtree. * cb/subtree-tests-update: contrib/subtree: small tidy-up to test contrib/subtree: fix broken &&-chains and revealed test error contrib/subtree: use tabs consitently for indentation in tests
2015-06-22contrib/subtree: small tidy-up to testCharles Bailey
There's no need to switch branches to parse another branch's ancestry. Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-22contrib/subtree: fix broken &&-chains and revealed test errorCharles Bailey
This fixes two instances where a &&-chain was broken in the subtree tests and fixes a test error that was revealed because of this. Many tests in t7900-subtree.sh make a commit and then use 'undo' to reset the state for the next test. In the 'check hash of split' test, an 'undo' was being invoked after a 'subtree split' even though the particular invocation of 'subtree split' did not actually make a commit. The subsequent check_equal was failing, but this failure was masked by that broken &&-chain. Removing this undo causes the failing check_equal to succeed but breaks the a check_equal later on in the same test. It turns out that an earlier test ('check if --message for merge works with squash too') makes a commit but doesn't 'undo' to the state expected by the remaining tests. None of the intervening tests cared enough about the state of the test repo to fail and the spurious 'undo' in 'check hash of split' restored the expected state for any remaining test that might care. Adding the missing 'undo' to 'check if --message for merge works with squash too' and removing the spurious one from 'check hash of split' fixes all tests once the &&-chains are completed. Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>