Git development
 help / color / mirror / Atom feed
* Re: [PATCH 01/19] spell checking
From: Jonathan Nieder @ 2013-03-09 20:25 UTC (permalink / raw)
  To: Paul Campbell; +Cc: Junio C Hamano, git, David Greene
In-Reply-To: <CALeLG_kdYjFhZXWedTgr2zdzJfrGV6XmqT1qkMX9XpJgztnPcg@mail.gmail.com>

Paul Campbell wrote:

> Four of the eight original authors now have dead email addresses. As I
> found out when I started getting the mail bounces when I started
> sending these patches out. Would it be acceptable for those patches to
> leave the From line, add a Based-on-patch-by and then sign of myself?

It's always nice to get the original author's sign-off, but if you can
certify what's stated in the DCO1.1 (from
Documentation/SubmittingPatches) then just adding your sign-off is
fine.  Please still keep the original authorship in that case, and no
need to add a Based-on-patch-by line.

Thanks,
Jonathan

^ permalink raw reply

* Segfault in git 1.8.1.5
From: Strasser Pablo @ 2013-03-09 20:16 UTC (permalink / raw)
  To: git

Hello,

I segfault with the following command:

git checkout HEAD~1
git branch -u origin/master

I think it's because i'm in detached head.
A error message like cannot use this command in would be a better responce 
than a segfault.

Good day.

^ permalink raw reply

* Re: [PATCH 01/19] spell checking
From: Paul Campbell @ 2013-03-09 20:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, David Greene
In-Reply-To: <7vobese4rp.fsf@alter.siamese.dyndns.org>

On Sat, Mar 9, 2013 at 7:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Paul Campbell <pcampbell@kemitix.net> writes:
>
>> From 72fc84b6e5085b328cc90e664c9f85a1f5cde36c Mon Sep 17 00:00:00 2001
>> From: Paul Cartwright <paul.cartwright@ziilabs.com>
>> Date: Thu, 27 Jan 2011 22:33:06 +0800
>> Subject: [PATCH 01/19] spell checking
>>
>> ---
>>  contrib/subtree/git-subtree.txt | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I won't repeat these for other 18 patches, but please:

Thanks and apologies. All noted, although I have a question below.

>  - drop the first "From <object name> <magic timestamp>" line which
>    is not part of the patch (it is only meant to help people who
>    maintain the "file(1)" and "magic(5)");
>
>  - keep "From: <author name> ..." and "Date: " lines for other
>    peoples' patches you are forwarding (they can be dropped for your
>    own patches); and
>
>  - drop "Subject: " as that is the same as the subject of the e-mail
>    message.
>
>  - fix the subject to make it clear that the change is for
>    contrib/subtree.
>
>    "spell checking" [*1*] in the output of "git shortlog v1.8.1..",
>    together with other 600+ patches' titles, will not help the
>    reader to see how much activity each area had and who worked in
>    what area.

I'd wanted to avoid changing the original author's work as much as
possible. Wrong choice on my part.

>  - have the authors sign-off their patches, and then add yours as
>    the person who is forwarding other peoples' patches (see
>    Documentation/SubmittingPatches).

Four of the eight original authors now have dead email addresses. As I
found out when I started getting the mail bounces when I started
sending these patches out. Would it be acceptable for those patches to
leave the From line, add a Based-on-patch-by and then sign of myself?
I've really only done enough on top of the cherry-picking to get round
any conflicts.

>  - Cc the area maintainer (I thought it was David Greene?)
>
> if these patches are meant to become part of git.git eventually.

I knew that and forgot. Can I blame this on my head-cold? No?

> Thanks.
>
>
> [Footnote]
>
> *1* Besides, a patch can never be "spell *checking*".  It would be
>  "typofix" after the author did a 'spell checking' ;-)

-- 
Paul [W] Campbell

^ permalink raw reply

* Re: [PATCH 01/19] spell checking
From: Junio C Hamano @ 2013-03-09 19:45 UTC (permalink / raw)
  To: Paul Campbell; +Cc: git
In-Reply-To: <CALeLG_=R4o1y-kA+n883nnAu+jrjgaA2ys2d+Vo9KasmVKeduQ@mail.gmail.com>

Paul Campbell <pcampbell@kemitix.net> writes:

> From 72fc84b6e5085b328cc90e664c9f85a1f5cde36c Mon Sep 17 00:00:00 2001
> From: Paul Cartwright <paul.cartwright@ziilabs.com>
> Date: Thu, 27 Jan 2011 22:33:06 +0800
> Subject: [PATCH 01/19] spell checking
>
> ---
>  contrib/subtree/git-subtree.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I won't repeat these for other 18 patches, but please:

 - drop the first "From <object name> <magic timestamp>" line which
   is not part of the patch (it is only meant to help people who
   maintain the "file(1)" and "magic(5)");

 - keep "From: <author name> ..." and "Date: " lines for other
   peoples' patches you are forwarding (they can be dropped for your
   own patches); and

 - drop "Subject: " as that is the same as the subject of the e-mail
   message.

 - fix the subject to make it clear that the change is for
   contrib/subtree.

   "spell checking" [*1*] in the output of "git shortlog v1.8.1..",
   together with other 600+ patches' titles, will not help the
   reader to see how much activity each area had and who worked in
   what area.

 - have the authors sign-off their patches, and then add yours as
   the person who is forwarding other peoples' patches (see
   Documentation/SubmittingPatches).

 - Cc the area maintainer (I thought it was David Greene?)

if these patches are meant to become part of git.git eventually.

Thanks.


[Footnote]

*1* Besides, a patch can never be "spell *checking*".  It would be
 "typofix" after the author did a 'spell checking' ;-)

^ permalink raw reply

* [PATCH 19/19] Fix some trailing whitespace
From: Paul Campbell @ 2013-03-09 19:31 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 54d376c3d731ce9e528fe9095ea6c16d382b5ce3 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:36:22 +0000
Subject: [PATCH 19/19] Fix some trailing whitespace

Conflicts:
	contrib/subtree/.gitignore
	contrib/subtree/git-subtree.sh
	contrib/subtree/test.sh

Original-Author: Herman van Rink <rink@initfour.nl>

OPTS_SPEC for push and pull updated (should have been picked up in an
earlier commit)

Fixed order of cases in setting the --default parameter

Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 223 +++++++++++++++++++++--------------------
 1 file changed, 114 insertions(+), 109 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 3582a55..df1413d 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -11,10 +11,10 @@ OPTS_SPEC="\
 git subtree add   --prefix=<prefix> <commit>
 git subtree add   --prefix=<prefix> <repository> <commit>
 git subtree merge --prefix=<prefix> <commit>
-git subtree pull  --prefix=<prefix> <repository> <refspec...>
+git subtree pull  --prefix=<prefix> [<repository> [<refspec>...]]
 git subtree pull-all
 git subtree push-all
-git subtree push  --prefix=<prefix> <repository> <refspec...>
+git subtree push  --prefix=<prefix> [<repository> [<refspec>...]]
 git subtree list
 git subtree split --prefix=<prefix> <commit...>
 git subtree diff  --prefix=<prefix> [<repository> [<refspec>...]]
@@ -92,7 +92,7 @@ while [ $# -gt 0 ]; do
 		-b) branch="$1"; shift ;;
 		-P) prefix="$1"; shift ;;
 		-m) message="$1"; shift ;;
-        -f|--force) force=1 ;;
+		-f|--force) force=1 ;;
 		--no-prefix) prefix= ;;
 		--onto) onto="$1"; shift ;;
 		--no-onto) onto= ;;
@@ -113,9 +113,9 @@ prefix="${prefix%/}";
 command="$1"
 shift
 case "$command" in
-    add|merge|pull|from-submodule|pull-all|push-all|prune) default= ;;
+	add|merge|pull|pull-all|push-all|from-submodule|prune) default= ;;
+	split|push|diff|list) default="--default HEAD" ;;
 	*) die "Unknown command '$command'" ;;
-    split|push|diff|list) default="--default HEAD" ;;
 esac

 if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" -a "$command" != "list" -a "$command" != "prune" ]; then
@@ -123,8 +123,10 @@ if [ -z "$prefix" -a "$command" != "pull-all" -a
"$command" != "push-all" -a "$c
 fi

 case "$command" in
-    pull-all);;
-    push-all);;
+	pull-all);;
+	push-all);;
+	list);;
+	prune);;
 	add) [ -e "$prefix" ] &&
 		die "prefix '$prefix' already exists." ;;
 	*)   [ -e "$prefix" ] ||
@@ -133,7 +135,7 @@ esac

 dir="$(dirname "$prefix/.")"

-if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" -a "$command" != "pull-all" ]; then
+if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" -a "$command" != "pull-all" -a "$command" != "diff" ]; then
 	revs=$(git rev-parse $default --revs-only "$@") || exit $?
 	dirs="$(git rev-parse --no-revs --no-flags "$@")" || exit $?
 	if [ -n "$dirs" ]; then
@@ -541,14 +543,14 @@ cmd_add_repository()
 	revs=FETCH_HEAD
 	set -- $revs
 	cmd_add_commit "$@"
-
-  # now add it to our list of repos
-  git config -f .gittrees --unset subtree.$dir.url
-  git config -f .gittrees --add subtree.$dir.url $repository
-  git config -f .gittrees --unset subtree.$dir.path
-  git config -f .gittrees --add subtree.$dir.path $dir
-  git config -f .gittrees --unset subtree.$dir.branch
-  git config -f .gittrees --add subtree.$dir.branch $refspec
+
+	# now add it to our list of repos
+	git config -f .gittrees --unset subtree.$dir.url
+	git config -f .gittrees --add subtree.$dir.url $repository
+	git config -f .gittrees --unset subtree.$dir.path
+	git config -f .gittrees --add subtree.$dir.path $dir
+	git config -f .gittrees --unset subtree.$dir.branch
+	git config -f .gittrees --add subtree.$dir.branch $refspec
 }

 cmd_add_commit()
@@ -721,89 +723,91 @@ cmd_merge()

 cmd_pull()
 {
-  if [ $# -gt 2 ]; then
-	    die "You should provide either <refspec> or <repository> <refspec>"
+	if [ $# -gt 2 ]; then
+		die "You should provide either <refspec> or <repository> <refspec>"
 	fi
 	if [ -e "$dir" ]; then
-	    ensure_clean
-      if [ $# -eq 1 ]; then
-	      repository=$(git config -f .gittrees subtree.$prefix.url)
-	      refspec=$1
-      elif [ $# -eq 2 ]; then
-        repository=$1
-        refspec=$2
-      else
-	      repository=$(git config -f .gittrees subtree.$prefix.url)
-        refspec=$(git config -f .gittrees subtree.$prefix.branch)
-      fi
-	    git fetch $repository $refspec || exit $?
-	    echo "git fetch using: " $repository $refspec
-	    revs=FETCH_HEAD
-	    set -- $revs
-	    cmd_merge "$@"
+		ensure_clean
+		if [ $# -eq 1 ]; then
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$1
+		elif [ $# -eq 2 ]; then
+			repository=$1
+			refspec=$2
+		else
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$(git config -f .gittrees subtree.$prefix.branch)
+		fi
+		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'."
+		die "'$dir' must already exist. Try 'git subtree add'."
 	fi
 }

-cmd_diff()
-{
-    if [ -e "$dir" ]; then
-        if [ $# -eq 1 ]; then
-            repository=$(git config -f .gittrees subtree.$prefix.url)
-            refspec=$1
-        elif [ $# -eq 2 ]; then
-            repository=$1
-            refspec=$2
-        else
-            repository=$(git config -f .gittrees subtree.$prefix.url)
-            refspec=$(git config -f .gittrees subtree.$prefix.branch)
-        fi
-        # this is ugly, but I don't know of a better way to do it. My
git-fu is weak.
-        # git diff-tree expects a treeish, but I have only a
repository and branch name.
-        # I don't know how to turn that into a treeish without
creating a remote.
-        # Please change this if you know a better way!
-        tmp_remote=__diff-tmp
-        git remote rm $tmp_remote > /dev/null 2>&1
-        git remote add -t $refspec $tmp_remote $repository > /dev/null
-        # we fetch as a separate step so we can pass -q (quiet),
which isn't an option for "git remote"
-        # could this instead be "git fetch -q $repository $refspec"
and leave aside creating the remote?
-        # Still need a treeish for the diff-tree command...
-        git fetch -q $tmp_remote
-        git diff-tree -p refs/remotes/$tmp_remote/$refspec
-        git remote rm $tmp_remote > /dev/null 2>&1
-    else
-        die "Cannot resolve directory '$dir'. Please point to an
existing subtree directory to diff. Try 'git subtree add' to add a
subtree."
-    fi
+cmd_diff()
+{
+	if [ -e "$dir" ]; then
+		if [ $# -eq 1 ]; then
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$1
+		elif [ $# -eq 2 ]; then
+			repository=$1
+			refspec=$2
+		else
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$(git config -f .gittrees subtree.$prefix.branch)
+		fi
+		# this is ugly, but I don't know of a better way to do it. My git-fu is weak.
+		# git diff-tree expects a treeish, but I have only a repository and
branch name.
+		# I don't know how to turn that into a treeish without creating a remote.
+		# Please change this if you know a better way!
+		tmp_remote=__diff-tmp
+		git remote rm $tmp_remote > /dev/null 2>&1
+		git remote add -t $refspec $tmp_remote $repository > /dev/null
+		# we fetch as a separate step so we can pass -q (quiet), which
isn't an option for "git remote"
+		# could this instead be "git fetch -q $repository $refspec" and
leave aside creating the remote?
+		# Still need a treeish for the diff-tree command...
+		git fetch -q $tmp_remote
+		git diff-tree -p refs/remotes/$tmp_remote/$refspec
+		git remote rm $tmp_remote > /dev/null 2>&1
+	else
+		die "Cannot resolve directory '$dir'. Please point to an existing
subtree directory to diff. Try 'git subtree add' to add a subtree."
+	fi
 }

 cmd_push()
 {
 	if [ $# -gt 2 ]; then
-	    die "You shold provide either <refspec> or <repository> <refspec>"
+		die "You shold provide either <refspec> or <repository> <refspec>"
 	fi
 	if [ -e "$dir" ]; then
-      if [ $# -eq 1 ]; then
-	      repository=$(git config -f .gittrees subtree.$prefix.url)
-        refspec=$1
-      elif [ $# -eq 2 ]; then
-        repository=$1
-        refspec=$2
-      else
-	      repository=$(git config -f .gittrees subtree.$prefix.url)
-        refspec=$(git config -f .gittrees subtree.$prefix.branch)
-      fi
-        push_opts=
-        if [ "$force" == "1" ]; then
-            push_opts="$push_opts --force"
-        fi
-	    echo "git push using: " $repository $refspec
-	    rev=$(git subtree split --prefix=$prefix)
-	    if [ -n "$rev" ]; then
-	        git push $push_opts $repository $rev:refs/heads/$refspec
-	    else
-	        die "Couldn't push, 'git subtree split' failed."
-	    fi
+		if [ $# -eq 1 ]; then
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$1
+		elif [ $# -eq 2 ]; then
+			repository=$1
+			refspec=$2
+		else
+			repository=$(git config -f .gittrees subtree.$prefix.url)
+			refspec=$(git config -f .gittrees subtree.$prefix.branch)
+		fi
+
+		push_opts=
+		if [ "$force" == "1" ]; then
+		  push_opts="$push_opts --force"
+		fi
+
+		echo "git push using: " $repository $refspec
+		rev=$(git subtree split --prefix=$prefix)
+		if [ -n "$rev" ]; then
+			git push $push_opts $repository $rev:refs/heads/$refspec
+		else
+			die "Couldn't push, 'git subtree split' failed."
+		fi
 	else
 	    die "'$dir' must already exist. Try 'git subtree add'."
 	fi
@@ -831,6 +835,7 @@ cmd_from-submodule()
 	git commit -m "Remove '$prefix/' submodule"

 	# subtree add from submodule repo.
+	# TODO: Could be determin HEAD to be a specific branch
 	cmd_add_repository $tmp_repo HEAD

 	# Update .gittrees with the original repo url
@@ -841,46 +846,46 @@ cmd_from-submodule()
 	rm -rf $tmp_repo
 }

-subtree_list()
+subtree_list()
 {
-    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-    while read path; do
-        repository=$(git config -f .gittrees subtree.$path.url)
-        refspec=$(git config -f .gittrees subtree.$path.branch)
-        echo "    $path        (merged from $repository branch $refspec) "
-    done
+	git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+	while read path; do
+		repository=$(git config -f .gittrees subtree.$path.url)
+		refspec=$(git config -f .gittrees subtree.$path.branch)
+		echo "	$path		(merged from $repository branch $refspec) "
+	done
 }

 cmd_list()
 {
-  subtree_list
+  subtree_list
 }

 cmd_prune()
 {
-    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-    while read path; do
-        if [ ! -e "$path" ]; then
-            echo "pruning $path"
-            git config -f .gittrees --remove-section subtree.$path
-        fi
-    done
+	git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+	while read path; do
+		if [ ! -e "$path" ]; then
+			echo "pruning $path"
+			git config -f .gittrees --remove-section subtree.$path
+		fi
+	done
 }

 cmd_pull-all()
 {
-    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-        while read path; do
-            git subtree pull -P $path master || exit $?
-        done
+	git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+	while read path; do
+		git subtree pull -P $path $(git config -f .gittrees
subtree.$path.url) $(git config -f .gittrees subtree.$path.branch) ||
exit $?
+	done
 }

 cmd_push-all()
 {
-    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-        while read path; do
-            git subtree push -P $path master || exit $?
-        done
+	git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+	while read path; do
+		git subtree push -P $path $(git config -f .gittrees
subtree.$path.url) $(git config -f .gittrees subtree.$path.branch) ||
exit $?
+	done
 }

 "cmd_$command" "$@"
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 18/19] Added --force option to push
From: Paul Campbell @ 2013-03-09 19:30 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From ae7c05bdc6d02fa89deabb59cec6150308f227f7 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:35:42 +0000
Subject: [PATCH 18/19] Added --force option to push

Conflicts:
	contrib/subtree/git-subtree.sh

Original-Author: James Roper <jroper@vz.net>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh  | 9 ++++++++-
 contrib/subtree/git-subtree.txt | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 4605203..3582a55 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -32,6 +32,8 @@ b,branch=     create a new branch from the split subtree
 ignore-joins  ignore prior --rejoin commits
 onto=         try connecting new tree to an existing one
 rejoin        merge the new branch back into HEAD
+ options for 'push'
+f,force       use force push
  options for 'add', 'merge', 'pull' and 'push'
 squash        merge subtree changes as a single commit
 "
@@ -90,6 +92,7 @@ while [ $# -gt 0 ]; do
 		-b) branch="$1"; shift ;;
 		-P) prefix="$1"; shift ;;
 		-m) message="$1"; shift ;;
+        -f|--force) force=1 ;;
 		--no-prefix) prefix= ;;
 		--onto) onto="$1"; shift ;;
 		--no-onto) onto= ;;
@@ -790,10 +793,14 @@ cmd_push()
 	      repository=$(git config -f .gittrees subtree.$prefix.url)
         refspec=$(git config -f .gittrees subtree.$prefix.branch)
       fi
+        push_opts=
+        if [ "$force" == "1" ]; then
+            push_opts="$push_opts --force"
+        fi
 	    echo "git push using: " $repository $refspec
 	    rev=$(git subtree split --prefix=$prefix)
 	    if [ -n "$rev" ]; then
-	        git push $repository $rev:refs/heads/$refspec
+	        git push $push_opts $repository $rev:refs/heads/$refspec
 	    else
 	        die "Couldn't push, 'git subtree split' failed."
 	    fi
diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index 385bde8..9e9eb9e 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -278,6 +278,11 @@ OPTIONS FOR split
 	'--rejoin' when you split, because you don't want the
 	subproject's history to be part of your project anyway.

+OPTIONS FOR push
+----------------
+-f::
+--force::
+    Uses 'git push --force'.

 EXAMPLE 1. Add command
 ----------------------
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 17/19] Document list command
From: Paul Campbell @ 2013-03-09 19:30 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From fed80cb47dffcb805a7808e8574dda44992363b0 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:35:18 +0000
Subject: [PATCH 17/19] Document list command

Conflicts:
	git-subtree.sh

Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh  | 1 +
 contrib/subtree/git-subtree.txt | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 84c90c7..4605203 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -15,6 +15,7 @@ git subtree pull  --prefix=<prefix> <repository> <refspec...>
 git subtree pull-all
 git subtree push-all
 git subtree push  --prefix=<prefix> <repository> <refspec...>
+git subtree list
 git subtree split --prefix=<prefix> <commit...>
 git subtree diff  --prefix=<prefix> [<repository> [<refspec>...]]
 git subtree from-submodule --prefix=<prefix>
diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index b485ab5..385bde8 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -15,6 +15,7 @@ SYNOPSIS
 'git subtree' pull-all
 'git subtree' push-all
 'git subtree' push  --prefix=<prefix> [<repository> [<refspec>...]]
+'git subtree' list
 'git subtree' split --prefix=<prefix> <commit...>
 'git subtree' from-submodule --prefix=<prefix>
 'git subtree' prune
@@ -108,6 +109,9 @@ push::
 push-all::
 	Perform a pull operation on all in .gittrees registered subtrees.

+list::
+	Show a list of the in .gittrees registered subtrees
+
 split::
 	Extract a new, synthetic project history from the
 	history of the <prefix> subtree.  The new history
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 16/19] Update SYNOPSIS
From: Paul Campbell @ 2013-03-09 19:29 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 6024d877e6c3beebe4c11bd060553d06af422680 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:34:54 +0000
Subject: [PATCH 16/19] Update SYNOPSIS

Conflicts:
	contrib/subtree/git-subtree.txt

Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.txt | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index 48ba158..b485ab5 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -9,13 +9,16 @@ git-subtree - Merge subtrees together and split
repository into subtrees
 SYNOPSIS
 --------
 [verse]
-'git subtree' add   -P <prefix> <refspec>
-'git subtree' add   -P <prefix> <repository> <refspec>
-'git subtree' pull  -P <prefix> <repository> <refspec...>
-'git subtree' push  -P <prefix> <repository> <refspec...>
-'git subtree' merge -P <prefix> <commit>
-'git subtree' split -P <prefix> [OPTIONS] [<commit>]
-
+'git subtree' add   --prefix=<prefix> <repository> <refspec>
+'git subtree' merge --prefix=<prefix> <commit>
+'git subtree' pull  --prefix=<prefix> [<repository> [<refspec>...]]
+'git subtree' pull-all
+'git subtree' push-all
+'git subtree' push  --prefix=<prefix> [<repository> [<refspec>...]]
+'git subtree' split --prefix=<prefix> <commit...>
+'git subtree' from-submodule --prefix=<prefix>
+'git subtree' prune
+'git subtree' diff  --prefix=<prefix> [<repository> [<refspec>...]]

 DESCRIPTION
 -----------
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 15/19] Document from-submodule and prune commands
From: Paul Campbell @ 2013-03-09 19:29 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 6dc8119a7d99f7107e32f2c5d7ec18b9fd93a6b8 Mon Sep 17 00:00:00 2001
From: Herman van Rink <rink@initfour.nl>
Date: Tue, 27 Mar 2012 14:14:54 +0200
Subject: [PATCH 15/19] Document from-submodule and prune commands

---
 contrib/subtree/git-subtree.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index c8fc103..48ba158 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -129,6 +129,16 @@ split::
 	Note that if you use '--squash' when you merge, you
 	should usually not just '--rejoin' when you split.

+from-submodule::
+	Convert a git submodule to a subtree.
+	The module is removed from the .gitmodules file and
+	the repo contents are integrated as a subtree.
+
+prune::
+	Cleanup .gittrees entries for which the subtree nolonger exists.
+
+diff::
+	TO BE DOCUMENTED

 OPTIONS
 -------
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH v2 3/3] git-merge-one-file: revise merge error reporting
From: Kevin Bracey @ 2013-03-09 19:21 UTC (permalink / raw)
  To: git; +Cc: Kevin Bracey, David Aguilar, Ciaran Jessup, Scott Chacon,
	Alex Riesen
In-Reply-To: <1362856860-15205-1-git-send-email-kevin@bracey.fi>

Commit 718135e improved the merge error reporting for the resolve
strategy's merge conflict and permission conflict cases, but led to a
malformed "ERROR:  in myfile.c" message in the case of a file added
differently.

This commit reverts that change, and uses an alternative approach without
this flaw.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
---
 git-merge-one-file.sh | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 1236fbf..70f36f1 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -104,11 +104,13 @@ case "${1:-.}${2:-.}${3:-.}" in
 		;;
 	esac
 
+	ret=0
 	src1=$(git-unpack-file $2)
 	src2=$(git-unpack-file $3)
 	case "$1" in
 	'')
-		echo "Added $4 in both, but differently."
+		echo "ERROR: Added $4 in both, but differently."
+		ret=1
 		orig=$(git-unpack-file $2)
 		create_virtual_base "$orig" "$src1" "$src2"
 		;;
@@ -121,10 +123,9 @@ case "${1:-.}${2:-.}${3:-.}" in
 	# Be careful for funny filename such as "-L" in "$4", which
 	# would confuse "merge" greatly.
 	git merge-file "$src1" "$orig" "$src2"
-	ret=$?
-	msg=
-	if [ $ret -ne 0 ]; then
-		msg='content conflict'
+	if [ $? -ne 0 ]; then
+		echo "ERROR: Content conflict in $4"
+		ret=1
 	fi
 
 	# Create the working tree file, using "our tree" version from the
@@ -133,18 +134,11 @@ case "${1:-.}${2:-.}${3:-.}" in
 	rm -f -- "$orig" "$src1" "$src2"
 
 	if [ "$6" != "$7" ]; then
-		if [ -n "$msg" ]; then
-			msg="$msg, "
-		fi
-		msg="${msg}permissions conflict: $5->$6,$7"
-		ret=1
-	fi
-	if [ "$1" = '' ]; then
+		echo "ERROR: Permissions conflict: $5->$6,$7"
 		ret=1
 	fi
 
 	if [ $ret -ne 0 ]; then
-		echo "ERROR: $msg in $4"
 		exit 1
 	fi
 	exec git update-index -- "$4"
-- 
1.8.2.rc3.7.g77aeedb

^ permalink raw reply related

* [PATCH 14/19] Document pull-all and push-all
From: Paul Campbell @ 2013-03-09 19:28 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 7dcd40ab8687a588b7b0c6ff914a7cfb601b6774 Mon Sep 17 00:00:00 2001
From: Herman van Rink <rink@initfour.nl>
Date: Tue, 27 Mar 2012 13:59:16 +0200
Subject: [PATCH 14/19] Document pull-all and push-all

---
 contrib/subtree/git-subtree.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index e0957ee..c8fc103 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -92,13 +92,19 @@ pull::
 	Exactly like 'merge', but parallels 'git pull' in that
 	it fetches the given commit from the specified remote
 	repository.
-	
+
+pull-all::
+	Perform a pull operation on all in .gittrees registered subtrees.
+
 push::
 	Does a 'split' (see below) using the <prefix> supplied
 	and then does a 'git push' to push the result to the
 	repository and refspec. This can be used to push your
 	subtree to different branches of the remote repository.

+push-all::
+	Perform a pull operation on all in .gittrees registered subtrees.
+
 split::
 	Extract a new, synthetic project history from the
 	history of the <prefix> subtree.  The new history
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 13/19] from-submodule: add url to .gittrees
From: Paul Campbell @ 2013-03-09 19:28 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From e1b71e3bf8abaea424972d13ba028b911b07d85a Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:34:31 +0000
Subject: [PATCH 13/19] from-submodule: add url to .gittrees

Conflicts:
	git-subtree.sh

Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index ae7d1fe..84c90c7 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -806,6 +806,7 @@ cmd_from-submodule()
 	ensure_clean

 	local submodule_sha=$(git submodule status $prefix | cut -d ' ' -f 2)
+	local submodule_orig_repo=$(git config --file .gitmodules
submodule.$prefix.url)

 	# Remove references to submodule.
 	git config --remove-section submodule.$prefix
@@ -824,6 +825,10 @@ cmd_from-submodule()
 	# subtree add from submodule repo.
 	cmd_add_repository $tmp_repo HEAD

+	# Update .gittrees with the original repo url
+	git config --file .gittrees --unset subtree.$prefix.url
+	git config --file .gittrees subtree.$prefix.url $submodule_orig_repo
+
 	# Remove submodule repo.
 	rm -rf $tmp_repo
 }
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 12/19] Remove trailing slash from prefix parameter
From: Paul Campbell @ 2013-03-09 19:27 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From d4aa87f53b61481d2f916415f0baec527a8b6417 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:34:10 +0000
Subject: [PATCH 12/19] Remove trailing slash from prefix parameter

Conflicts:
	git-subtree.sh

Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index d67fe5a..ae7d1fe 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -103,6 +103,9 @@ while [ $# -gt 0 ]; do
 	esac
 done

+# Remove trailing slash
+prefix="${prefix%/}";
+
 command="$1"
 shift
 case "$command" in
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 11/19] Add prune command to OPTS_SPEC
From: Paul Campbell @ 2013-03-09 19:27 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 48e77d62e05582e2aec4c634a913f28f3f804a37 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:33:50 +0000
Subject: [PATCH 11/19] Add prune command to OPTS_SPEC

Conflicts:
	git-subtree.sh

Original-Author: Herman van Rink <rink@initfour.nl>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 0c41383..d67fe5a 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -18,6 +18,7 @@ git subtree push  --prefix=<prefix> <repository> <refspec...>
 git subtree split --prefix=<prefix> <commit...>
 git subtree diff  --prefix=<prefix> [<repository> [<refspec>...]]
 git subtree from-submodule --prefix=<prefix>
+git subtree prune
 --
 h,help        show the help
 q             quiet
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 10/19] 'prune' command to clear out stale .gittrees info
From: Paul Campbell @ 2013-03-09 19:27 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 1aaa55ff64b3b4d9325568b3bb863748f20c80f3 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:33:33 +0000
Subject: [PATCH 10/19] 'prune' command to clear out stale .gittrees info

Conflicts:
	git-subtree.sh

Original-Author: Nate Jones <nate@endot.org>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7d08064..0c41383 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -105,12 +105,12 @@ done
 command="$1"
 shift
 case "$command" in
-	add|merge|pull|from-submodule|pull-all|push-all) default= ;;
+    add|merge|pull|from-submodule|pull-all|push-all|prune) default= ;;
 	*) die "Unknown command '$command'" ;;
     split|push|diff|list) default="--default HEAD" ;;
 esac

-if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" -a "$command" != "list" ]; then
+if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" -a "$command" != "list" -a "$command" != "prune" ]; then
 	die "You must provide the --prefix option."
 fi

@@ -839,6 +839,17 @@ cmd_list()
   subtree_list
 }

+cmd_prune()
+{
+    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+    while read path; do
+        if [ ! -e "$path" ]; then
+            echo "pruning $path"
+            git config -f .gittrees --remove-section subtree.$path
+        fi
+    done
+}
+
 cmd_pull-all()
 {
     git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 09/19] Adding a "list" command
From: Paul Campbell @ 2013-03-09 19:26 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From ca1c855c032d88159ed878f68ef2e18640bbd49c Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:33:12 +0000
Subject: [PATCH 09/19] Adding a "list" command

Conflicts:
	git-subtree.sh

Original-Author: mhoffman <matt.hoffman@quantumretail.com>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 4c3f3c0..7d08064 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -107,10 +107,10 @@ shift
 case "$command" in
 	add|merge|pull|from-submodule|pull-all|push-all) default= ;;
 	*) die "Unknown command '$command'" ;;
-    split|push|diff) default="--default HEAD" ;;
+    split|push|diff|list) default="--default HEAD" ;;
 esac

-if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" ]; then
+if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" -a "$command" != "list" ]; then
 	die "You must provide the --prefix option."
 fi

@@ -824,6 +824,21 @@ cmd_from-submodule()
 	rm -rf $tmp_repo
 }

+subtree_list()
+{
+    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+    while read path; do
+        repository=$(git config -f .gittrees subtree.$path.url)
+        refspec=$(git config -f .gittrees subtree.$path.branch)
+        echo "    $path        (merged from $repository branch $refspec) "
+    done
+}
+
+cmd_list()
+{
+  subtree_list
+}
+
 cmd_pull-all()
 {
     git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 08/19] fixing typo
From: Paul Campbell @ 2013-03-09 19:26 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 8f6eb2ddfcaef888dc3d3ea4d089aa2e9cad5d0f Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:32:53 +0000
Subject: [PATCH 08/19] fixing typo

Conflicts:
	git-subtree.sh

Add diff command

Original-Author: mhoffman <matt.hoffman@quantumretail.com>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index ae9f87f..4c3f3c0 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -16,6 +16,7 @@ git subtree pull-all
 git subtree push-all
 git subtree push  --prefix=<prefix> <repository> <refspec...>
 git subtree split --prefix=<prefix> <commit...>
+git subtree diff  --prefix=<prefix> [<repository> [<refspec>...]]
 git subtree from-submodule --prefix=<prefix>
 --
 h,help        show the help
@@ -105,8 +106,8 @@ command="$1"
 shift
 case "$command" in
 	add|merge|pull|from-submodule|pull-all|push-all) default= ;;
-	split|push) default="--default HEAD" ;;
 	*) die "Unknown command '$command'" ;;
+    split|push|diff) default="--default HEAD" ;;
 esac

 if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" ]; then
@@ -737,6 +738,37 @@ cmd_pull()
 	fi
 }

+cmd_diff()
+{
+    if [ -e "$dir" ]; then
+        if [ $# -eq 1 ]; then
+            repository=$(git config -f .gittrees subtree.$prefix.url)
+            refspec=$1
+        elif [ $# -eq 2 ]; then
+            repository=$1
+            refspec=$2
+        else
+            repository=$(git config -f .gittrees subtree.$prefix.url)
+            refspec=$(git config -f .gittrees subtree.$prefix.branch)
+        fi
+        # this is ugly, but I don't know of a better way to do it. My
git-fu is weak.
+        # git diff-tree expects a treeish, but I have only a
repository and branch name.
+        # I don't know how to turn that into a treeish without
creating a remote.
+        # Please change this if you know a better way!
+        tmp_remote=__diff-tmp
+        git remote rm $tmp_remote > /dev/null 2>&1
+        git remote add -t $refspec $tmp_remote $repository > /dev/null
+        # we fetch as a separate step so we can pass -q (quiet),
which isn't an option for "git remote"
+        # could this instead be "git fetch -q $repository $refspec"
and leave aside creating the remote?
+        # Still need a treeish for the diff-tree command...
+        git fetch -q $tmp_remote
+        git diff-tree -p refs/remotes/$tmp_remote/$refspec
+        git remote rm $tmp_remote > /dev/null 2>&1
+    else
+        die "Cannot resolve directory '$dir'. Please point to an
existing subtree directory to diff. Try 'git subtree add' to add a
subtree."
+    fi
+}
+
 cmd_push()
 {
 	if [ $# -gt 2 ]; then
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 07/19] Added check to ensure that split succeeds before trying to push
From: Paul Campbell @ 2013-03-09 19:25 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From ef4d4081474bd9925b60c2ab856260d9174220b9 Mon Sep 17 00:00:00 2001
From: mhart <michael@adslot.com>
Date: Sun, 16 Oct 2011 00:16:53 +1100
Subject: [PATCH 07/19] Added check to ensure that split succeeds before trying
 to push

---
 contrib/subtree/git-subtree.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 8056851..ae9f87f 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -754,7 +754,12 @@ cmd_push()
         refspec=$(git config -f .gittrees subtree.$prefix.branch)
       fi
 	    echo "git push using: " $repository $refspec
-	    git push $repository $(git subtree split
--prefix=$prefix):refs/heads/$refspec
+	    rev=$(git subtree split --prefix=$prefix)
+	    if [ -n "$rev" ]; then
+	        git push $repository $rev:refs/heads/$refspec
+	    else
+	        die "Couldn't push, 'git subtree split' failed."
+	    fi
 	else
 	    die "'$dir' must already exist. Try 'git subtree add'."
 	fi
-- 
1.8.2.rc1

-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 06/19] merging change from nresni
From: Paul Campbell @ 2013-03-09 19:25 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From b6c810480547966c73bcaaea4c069fe73dacbc05 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:32:24 +0000
Subject: [PATCH 06/19] merging change from nresni

manual merge at the moment...i'll try a proper merge next now that
formatting is cleaner

Conflicts:
	git-subtree.sh

Fixes hidden carriage return

Original-Author: mhoffman <matt.hoffman@quantumretail.com>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 74e4c74..8056851 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -605,8 +605,7 @@ cmd_split()
 	eval "$grl" |
 	while read rev parents; do
 		revcount=$(($revcount + 1))
-		say -n "$revcount/$revmax ($createcount)
-"
+		say -ne "$revcount/$revmax ($createcount)\r"
 		debug "Processing commit: $rev"
 		exists=$(cache_get $rev)
 		if [ -n "$exists" ]; then
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 05/19] A number of changes to push_all and pull_all:
From: Paul Campbell @ 2013-03-09 19:24 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 10f2260165d6be3a6ab477ed38fd8ab0308c11e6 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:31:59 +0000
Subject: [PATCH 05/19] A number of changes to push_all and pull_all:

* adding commands in "add" to populate the .gittrees file
* changing underscores to dashes (push_all -> push-all)
* changing commands to not be hardcoded to branch "master" from remote
* letting the user specify 0, 1, or 2 arguments to push and pull, like
normal "git push" and "git pull".  We'll try to look up missing
information from .gittrees, like git normally does from .git/config

Conflicts:
	.gitignore
	contrib/subtree/git-subtree.sh

Original-Author: mhoffman <matt.hoffman@quantumretail.com>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 57 ++++++++++++++++++++++++++++++------------
 1 file changed, 41 insertions(+), 16 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index c3b1208..74e4c74 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -12,7 +12,8 @@ git subtree add   --prefix=<prefix> <commit>
 git subtree add   --prefix=<prefix> <repository> <commit>
 git subtree merge --prefix=<prefix> <commit>
 git subtree pull  --prefix=<prefix> <repository> <refspec...>
-git subtree pull_all
+git subtree pull-all
+git subtree push-all
 git subtree push  --prefix=<prefix> <repository> <refspec...>
 git subtree split --prefix=<prefix> <commit...>
 git subtree from-submodule --prefix=<prefix>
@@ -103,18 +104,18 @@ done
 command="$1"
 shift
 case "$command" in
-	add|merge|pull|from-submodule|pull_all|push_all) default= ;;
+	add|merge|pull|from-submodule|pull-all|push-all) default= ;;
 	split|push) default="--default HEAD" ;;
 	*) die "Unknown command '$command'" ;;
 esac

-if [ -z "$prefix" -a "$command" != "pull_all" -a "$command" !=
"push_all" ]; then
+if [ -z "$prefix" -a "$command" != "pull-all" -a "$command" !=
"push-all" ]; then
 	die "You must provide the --prefix option."
 fi

 case "$command" in
-    pull_all);;
-    push_all);;
+    pull-all);;
+    push-all);;
 	add) [ -e "$prefix" ] &&
 		die "prefix '$prefix' already exists." ;;
 	*)   [ -e "$prefix" ] ||
@@ -123,7 +124,7 @@ esac

 dir="$(dirname "$prefix/.")"

-if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" -a "$command" != "pull_all" ]; then
+if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" -a "$command" != "pull-all" ]; then
 	revs=$(git rev-parse $default --revs-only "$@") || exit $?
 	dirs="$(git rev-parse --no-revs --no-flags "$@")" || exit $?
 	if [ -n "$dirs" ]; then
@@ -531,6 +532,14 @@ cmd_add_repository()
 	revs=FETCH_HEAD
 	set -- $revs
 	cmd_add_commit "$@"
+
+  # now add it to our list of repos
+  git config -f .gittrees --unset subtree.$dir.url
+  git config -f .gittrees --add subtree.$dir.url $repository
+  git config -f .gittrees --unset subtree.$dir.path
+  git config -f .gittrees --add subtree.$dir.path $dir
+  git config -f .gittrees --unset subtree.$dir.branch
+  git config -f .gittrees --add subtree.$dir.branch $refspec
 }

 cmd_add_commit()
@@ -704,13 +713,21 @@ cmd_merge()

 cmd_pull()
 {
-    if [ $# -ne 1 ]; then
-	    die "You must provide <branch>"
+  if [ $# -gt 2 ]; then
+	    die "You should provide either <refspec> or <repository> <refspec>"
 	fi
 	if [ -e "$dir" ]; then
 	    ensure_clean
-	    repository=$(git config -f .gittrees subtree.$prefix.url)
-	    refspec=$1
+      if [ $# -eq 1 ]; then
+	      repository=$(git config -f .gittrees subtree.$prefix.url)
+	      refspec=$1
+      elif [ $# -eq 2 ]; then
+        repository=$1
+        refspec=$2
+      else
+	      repository=$(git config -f .gittrees subtree.$prefix.url)
+        refspec=$(git config -f .gittrees subtree.$prefix.branch)
+      fi
 	    git fetch $repository $refspec || exit $?
 	    echo "git fetch using: " $repository $refspec
 	    revs=FETCH_HEAD
@@ -723,12 +740,20 @@ cmd_pull()

 cmd_push()
 {
-	if [ $# -ne 1 ]; then
-	    die "You must provide <branch>"
+	if [ $# -gt 2 ]; then
+	    die "You shold provide either <refspec> or <repository> <refspec>"
 	fi
 	if [ -e "$dir" ]; then
-	    repository=$(git config -f .gittrees subtree.$prefix.url)
-	    refspec=$1
+      if [ $# -eq 1 ]; then
+	      repository=$(git config -f .gittrees subtree.$prefix.url)
+        refspec=$1
+      elif [ $# -eq 2 ]; then
+        repository=$1
+        refspec=$2
+      else
+	      repository=$(git config -f .gittrees subtree.$prefix.url)
+        refspec=$(git config -f .gittrees subtree.$prefix.branch)
+      fi
 	    echo "git push using: " $repository $refspec
 	    git push $repository $(git subtree split
--prefix=$prefix):refs/heads/$refspec
 	else
@@ -763,7 +788,7 @@ cmd_from-submodule()
 	rm -rf $tmp_repo
 }

-cmd_pull_all()
+cmd_pull-all()
 {
     git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
         while read path; do
@@ -771,7 +796,7 @@ cmd_pull_all()
         done
 }

-cmd_push_all()
+cmd_push-all()
 {
     git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
         while read path; do
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 04/19] new commands: pull_all and push_all
From: Paul Campbell @ 2013-03-09 19:23 UTC (permalink / raw)
  To: git
  Cc: David Michael Barr, Kindjal, bibendi, Herman van Rink, mhoffman,
	Nate Jones

>From 7e20edee694cbcbac79be4fbe37d9cedebe3e4ee Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:31:37 +0000
Subject: [PATCH 04/19] new commands: pull_all and push_all

Conflicts:
	contrib/subtree/git-subtree.sh

Original-Author: bibendi <bibendi@bk.ru>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index cb9e288..c3b1208 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -12,6 +12,7 @@ git subtree add   --prefix=<prefix> <commit>
 git subtree add   --prefix=<prefix> <repository> <commit>
 git subtree merge --prefix=<prefix> <commit>
 git subtree pull  --prefix=<prefix> <repository> <refspec...>
+git subtree pull_all
 git subtree push  --prefix=<prefix> <repository> <refspec...>
 git subtree split --prefix=<prefix> <commit...>
 git subtree from-submodule --prefix=<prefix>
@@ -102,16 +103,18 @@ done
 command="$1"
 shift
 case "$command" in
-	add|merge|pull|from-submodule) default= ;;
+	add|merge|pull|from-submodule|pull_all|push_all) default= ;;
 	split|push) default="--default HEAD" ;;
 	*) die "Unknown command '$command'" ;;
 esac

-if [ -z "$prefix" ]; then
+if [ -z "$prefix" -a "$command" != "pull_all" -a "$command" !=
"push_all" ]; then
 	die "You must provide the --prefix option."
 fi

 case "$command" in
+    pull_all);;
+    push_all);;
 	add) [ -e "$prefix" ] &&
 		die "prefix '$prefix' already exists." ;;
 	*)   [ -e "$prefix" ] ||
@@ -120,7 +123,7 @@ esac

 dir="$(dirname "$prefix/.")"

-if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" ]; then
+if [ "$command" != "pull" -a "$command" != "add" -a "$command" !=
"push" -a "$command" != "pull_all" ]; then
 	revs=$(git rev-parse $default --revs-only "$@") || exit $?
 	dirs="$(git rev-parse --no-revs --no-flags "$@")" || exit $?
 	if [ -n "$dirs" ]; then
@@ -760,4 +763,20 @@ cmd_from-submodule()
 	rm -rf $tmp_repo
 }

+cmd_pull_all()
+{
+    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+        while read path; do
+            git subtree pull -P $path master || exit $?
+        done
+}
+
+cmd_push_all()
+{
+    git config -f .gittrees -l | grep subtree | grep path | grep -o
'=.*' | grep -o '[^=].*' |
+        while read path; do
+            git subtree push -P $path master || exit $?
+        done
+}
+
 "cmd_$command" "$@"
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 03/19] Use .gittrees config file like a .gitmodules when pull or push
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

* [PATCH v2 1/3] mergetools/p4merge: swap LOCAL and REMOTE
From: Kevin Bracey @ 2013-03-09 19:20 UTC (permalink / raw)
  To: git; +Cc: Kevin Bracey, David Aguilar, Ciaran Jessup, Scott Chacon,
	Alex Riesen
In-Reply-To: <1362856860-15205-1-git-send-email-kevin@bracey.fi>

Reverse LOCAL and REMOTE when invoking P4Merge as a mergetool, so that
the incoming branch is now in the left-hand, blue triangle pane, and the
current branch is in the right-hand, green circle pane.

This change makes use of P4Merge consistent with its built-in help, its
reference documentation, and Perforce itself. But most importantly, it
makes merge results clearer. P4Merge is not totally symmetrical between
left and right; despite changing a few text labels from "theirs/ours" to
"left/right" when invoked manually, it still retains its original
Perforce "theirs/ours" viewpoint.

Most obviously, in the result pane P4Merge shows changes that are common
to both branches in green. This is on the basis of the current branch
being green, as it is when invoked from Perforce; it means that lines in
the result are blue if and only if they are being changed by the merge,
making the resulting diff clearer.

Note that P4Merge now shows "ours" on the right for both diff and merge,
unlike other diff/mergetools, which always have REMOTE on the right.
But observe that REMOTE is the working tree (ie "ours") for a diff,
while it's another branch (ie "theirs") for a merge.

Ours and theirs are reversed for a rebase - see "git help rebase".
However, this does produce the desired "show the results of this commit"
effect in P4Merge - changes that remain in the rebased commit (in your
branch, but not in the new base) appear in blue; changes that do not
appear in the rebased commit (from the new base, or common to both) are
in green. If Perforce had rebase, they'd probably not swap ours/theirs,
but make P4Merge show common changes in blue, picking out our changes in
green. We can't do that, so this is next best.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
---
 mergetools/p4merge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mergetools/p4merge b/mergetools/p4merge
index 8a36916..46b3a5a 100644
--- a/mergetools/p4merge
+++ b/mergetools/p4merge
@@ -22,7 +22,7 @@ diff_cmd () {
 merge_cmd () {
 	touch "$BACKUP"
 	$base_present || >"$BASE"
-	"$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
+	"$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
 	check_unchanged
 }
 
-- 
1.8.2.rc3.7.g77aeedb

^ permalink raw reply related

* [PATCH 02/19] Add from-submodule. Conflicts: .gitignore contrib/subtree/git-subtree.sh test.sh
From: Paul Campbell @ 2013-03-09 19:20 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 718c99d167255b28830b6f684d6e6e184fba0f7c Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Sat, 9 Mar 2013 18:30:20 +0000
Subject: [PATCH 02/19] Add from-submodule. Conflicts: 	.gitignore
 contrib/subtree/git-subtree.sh 	test.sh

Original-Author: Peter Jaros <pjaros@pivotallabs.com>
Conflicts-resolved-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 8a23f58..caf4988 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -14,6 +14,7 @@ git subtree merge --prefix=<prefix> <commit>
 git subtree pull  --prefix=<prefix> <repository> <refspec...>
 git subtree push  --prefix=<prefix> <repository> <refspec...>
 git subtree split --prefix=<prefix> <commit...>
+git subtree from-submodule --prefix=<prefix>
 --
 h,help        show the help
 q             quiet
@@ -101,7 +102,7 @@ done
 command="$1"
 shift
 case "$command" in
-	add|merge|pull) default= ;;
+	add|merge|pull|from-submodule) default= ;;
 	split|push) default="--default HEAD" ;;
 	*) die "Unknown command '$command'" ;;
 esac
@@ -721,4 +722,31 @@ cmd_push()
 	fi
 }

+cmd_from-submodule()
+{
+	ensure_clean
+
+	local submodule_sha=$(git submodule status $prefix | cut -d ' ' -f 2)
+
+	# Remove references to submodule.
+	git config --remove-section submodule.$prefix
+	git config --file .gitmodules --remove-section submodule.$prefix
+	git add .gitmodules
+
+	# Move submodule aside.
+	local tmp_repo="$(mktemp -d /tmp/git-subtree.XXXXX)"
+	rm -r $tmp_repo
+	mv $prefix $tmp_repo
+	git rm $prefix
+
+	# Commit changes.
+	git commit -m "Remove '$prefix/' submodule"
+
+	# subtree add from submodule repo.
+	cmd_add_repository $tmp_repo HEAD
+
+	# Remove submodule repo.
+	rm -rf $tmp_repo
+}
+
 "cmd_$command" "$@"
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related

* [PATCH 01/19] spell checking
From: Paul Campbell @ 2013-03-09 19:19 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 72fc84b6e5085b328cc90e664c9f85a1f5cde36c Mon Sep 17 00:00:00 2001
From: Paul Cartwright <paul.cartwright@ziilabs.com>
Date: Thu, 27 Jan 2011 22:33:06 +0800
Subject: [PATCH 01/19] spell checking

---
 contrib/subtree/git-subtree.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index 7ba853e..e0957ee 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -270,7 +270,7 @@ git-extensions repository in ~/git-extensions/:
 name

 You can omit the --squash flag, but doing so will increase the number
-of commits that are incldued in your local repository.
+of commits that are included in your local repository.

 We now have a ~/git-extensions/git-subtree directory containing code
 from the master branch of git://github.com/apenwarr/git-subtree.git
-- 
1.8.2.rc1


-- 
Paul [W] Campbell

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox