* [PATCH 03/19] Use .gittrees config file like a .gitmodules when pull or push
@ 2013-03-09 19:21 Paul Campbell
0 siblings, 0 replies; only message in thread
From: Paul Campbell @ 2013-03-09 19:21 UTC (permalink / raw)
To: git
Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink,
James Roper, mhart, mhoffman, Nate Jones, Paul Cartwright,
Peter Jaros
>From 92787322c6e0e8c9166f02f98a71b6e0af9dc405 Mon Sep 17 00:00:00 2001
From: bibendi <bibendi@bk.ru>
Date: Fri, 20 May 2011 00:15:53 +0600
Subject: [PATCH 03/19] Use .gittrees config file like a .gitmodules when pull
or push
---
contrib/subtree/git-subtree.sh | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index caf4988..cb9e288 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -593,7 +593,8 @@ cmd_split()
eval "$grl" |
while read rev parents; do
revcount=$(($revcount + 1))
- say -n "$revcount/$revmax ($createcount)
"
+ say -n "$revcount/$revmax ($createcount)
+"
debug "Processing commit: $rev"
exists=$(cache_get $rev)
if [ -n "$exists" ]; then
@@ -700,21 +701,31 @@ cmd_merge()
cmd_pull()
{
- ensure_clean
- git fetch "$@" || exit $?
- revs=FETCH_HEAD
- set -- $revs
- cmd_merge "$@"
+ if [ $# -ne 1 ]; then
+ die "You must provide <branch>"
+ fi
+ if [ -e "$dir" ]; then
+ ensure_clean
+ repository=$(git config -f .gittrees subtree.$prefix.url)
+ refspec=$1
+ git fetch $repository $refspec || exit $?
+ echo "git fetch using: " $repository $refspec
+ revs=FETCH_HEAD
+ set -- $revs
+ cmd_merge "$@"
+ else
+ die "'$dir' must already exist. Try 'git subtree add'."
+ fi
}
cmd_push()
{
- if [ $# -ne 2 ]; then
- die "You must provide <repository> <refspec>"
+ if [ $# -ne 1 ]; then
+ die "You must provide <branch>"
fi
if [ -e "$dir" ]; then
- repository=$1
- refspec=$2
+ repository=$(git config -f .gittrees subtree.$prefix.url)
+ refspec=$1
echo "git push using: " $repository $refspec
git push $repository $(git subtree split
--prefix=$prefix):refs/heads/$refspec
else
--
1.8.2.rc1
--
Paul [W] Campbell
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-09 19:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09 19:21 [PATCH 03/19] Use .gittrees config file like a .gitmodules when pull or push Paul Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).