{"thread":{"id":"33175","subject":"[PATCH 0/4] contrib/subtree: general updates","startedAt":"2013-03-13T22:32:39Z","lastAt":"2013-03-24T00:16:18Z","messageCount":10,"participants":["Paul Campbell","Miles Bader","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"211257","messageId":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":null,"subject":"[PATCH 0/4] contrib/subtree: general updates","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:32:39Z","receivedAt":"2013-03-13T22:32:39Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"Less ambitious patch series this time.\n\nJames and Michael's patches add if clauses that use the\nbashism 'if []' rather than 'if test'. I've left them as\nthey are to match the other if clauses within the\ngit-subtree.sh file. I remember reading a comment on the\nlist about matching the local style being more important\nthan the overall project's style. I'm happy to change them\notherwise.\n\nJames Roper (1):\n  contrib/subtree: Teach push to use --force option\n\nMatt Hoffman (1):\n  contrib/subtree: Replace invisible carriage return with a visible \\r\n\nMichael Hart (1):\n  contrib/subtree: Teach push to abort if split fails\n\nPaul Cartwright (1):\n  contrib/subtree: Fix typo (s/incldued/included/)\n\n contrib/subtree/git-subtree.sh  | 16 ++++++++++++++--\n contrib/subtree/git-subtree.txt |  7 ++++++-\n 2 files changed, 20 insertions(+), 3 deletions(-)\n\n-- \n1.8.2\n"},{"id":"211258","messageId":"1363213963-4065-2-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","subject":"[PATCH 1/4] contrib/subtree: Teach push to abort if split fails","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:32:40Z","receivedAt":"2013-03-13T22:32:40Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"From: Michael Hart <michael@adslot.com>\n\nIf the subtree split fails it doesn't return the SHA that should be\npushed to the other repository.\n\nAdded a check to ensure that split succeeds before trying to push\nand display an error message.\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n contrib/subtree/git-subtree.sh | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 8a23f58..c68cc6f 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -715,7 +715,12 @@ cmd_push()\n \t    repository=$1\n \t    refspec=$2\n \t    echo \"git push using: \" $repository $refspec\n-\t    git push $repository $(git subtree split --prefix=$prefix):refs/heads/$refspec\n+\t    rev=$(git subtree split --prefix=$prefix)\n+\t    if [ -n \"$rev\" ]; then\n+\t\tgit push $repository $rev:refs/heads/$refspec\n+\t    else\n+\t\tdie \"Couldn't push, 'git subtree split' failed.\"\n+\t    fi\n \telse\n \t    die \"'$dir' must already exist. Try 'git subtree add'.\"\n \tfi\n-- \n1.8.2\n"},{"id":"211260","messageId":"1363213963-4065-3-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","subject":"[PATCH 2/4] contrib/subtree: Teach push to use --force option","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:32:41Z","receivedAt":"2013-03-13T22:32:41Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"From: James Roper <jroper@vz.net>\n\nAllow the --force option to be passed to the child push command.\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n contrib/subtree/git-subtree.sh  | 9 ++++++++-\n contrib/subtree/git-subtree.txt | 5 +++++\n 2 files changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex c68cc6f..2d9b071 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -26,6 +26,8 @@ b,branch=     create a new branch from the split subtree\n ignore-joins  ignore prior --rejoin commits\n onto=         try connecting new tree to an existing one\n rejoin        merge the new branch back into HEAD\n+ options for 'push'\n+f,force       use force push\n  options for 'add', 'merge', 'pull' and 'push'\n squash        merge subtree changes as a single commit\n \"\n@@ -84,6 +86,7 @@ while [ $# -gt 0 ]; do\n \t\t-b) branch=\"$1\"; shift ;;\n \t\t-P) prefix=\"$1\"; shift ;;\n \t\t-m) message=\"$1\"; shift ;;\n+\t\t-f|--force) force=1 ;;\n \t\t--no-prefix) prefix= ;;\n \t\t--onto) onto=\"$1\"; shift ;;\n \t\t--no-onto) onto= ;;\n@@ -712,12 +715,16 @@ cmd_push()\n \t    die \"You must provide <repository> <refspec>\"\n \tfi\n \tif [ -e \"$dir\" ]; then\n+\t    push_opts=\n+\t    if [ \"$force\" == \"1\" ]; then\n+\t\tpush_opts=\"$push_opts --force\"\n+\t    fi\n \t    repository=$1\n \t    refspec=$2\n \t    echo \"git push using: \" $repository $refspec\n \t    rev=$(git subtree split --prefix=$prefix)\n \t    if [ -n \"$rev\" ]; then\n-\t\tgit push $repository $rev:refs/heads/$refspec\n+\t\tgit push $push_opts $repository $rev:refs/heads/$refspec\n \t    else\n \t\tdie \"Couldn't push, 'git subtree split' failed.\"\n \t    fi\ndiff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\nindex 7ba853e..97dd3c9 100644\n--- a/contrib/subtree/git-subtree.txt\n+++ b/contrib/subtree/git-subtree.txt\n@@ -255,6 +255,11 @@ OPTIONS FOR split\n \t'--rejoin' when you split, because you don't want the\n \tsubproject's history to be part of your project anyway.\n \n+OPTIONS FOR push\n+----------------\n+-f::\n+--force::\n+    Uses 'git push --force'.\n \n EXAMPLE 1. Add command\n ----------------------\n-- \n1.8.2\n"},{"id":"211259","messageId":"1363213963-4065-4-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","subject":"[PATCH 3/4] contrib/subtree: Fix typo (s/incldued/included/)","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:32:42Z","receivedAt":"2013-03-13T22:32:42Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"From: Paul Cartwright <paul.cartwright@ziilabs.com>\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n contrib/subtree/git-subtree.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\nindex 97dd3c9..e1bfa61 100644\n--- a/contrib/subtree/git-subtree.txt\n+++ b/contrib/subtree/git-subtree.txt\n@@ -275,7 +275,7 @@ git-extensions repository in ~/git-extensions/:\n name\n \n You can omit the --squash flag, but doing so will increase the number\n-of commits that are incldued in your local repository.\n+of commits that are included in your local repository.\n \n We now have a ~/git-extensions/git-subtree directory containing code\n from the master branch of git://github.com/apenwarr/git-subtree.git\n-- \n1.8.2\n"},{"id":"211261","messageId":"1363213963-4065-5-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","subject":"[PATCH 4/4] contrib/subtree: Replace invisible carriage return with a visible \\r","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:32:43Z","receivedAt":"2013-03-13T22:32:43Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"From: Matt Hoffman <matt.hoffman@quantumretail.com>\n\nThe ctrl-M (^M) character used for the carriage return (CR) is not visible\nin all (most) text editors and is often silently converted to a new\nline (NL) or CR/NL combo.\n\n'say' is a wrapper for echo with accepts the option -e to interperet\nescaped characters. \\r becomes a CR, yet is not munged by text\neditors.\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n\nConflicts:\n\tgit-subtree.sh\n---\n contrib/subtree/git-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 2d9b071..5314bd0 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -595,7 +595,7 @@ cmd_split()\n \teval \"$grl\" |\n \twhile read rev parents; do\n \t\trevcount=$(($revcount + 1))\n-\t\tsay -n \"$revcount/$revmax ($createcount)\n\"\n+\t\tsay -ne \"$revcount/$revmax ($createcount)\\r\"\n \t\tdebug \"Processing commit: $rev\"\n \t\texists=$(cache_get $rev)\n \t\tif [ -n \"$exists\" ]; then\n-- \n1.8.2\n"},{"id":"211262","messageId":"CALeLG_kSye2xRoUJ8ytjx-bsj6oSG_brPbj-X3yfXuLA-KEppA@mail.gmail.com","threadId":"33175","inReplyTo":"1363213963-4065-5-git-send-email-pcampbell@kemitix.net","subject":"Re: [PATCH 4/4] contrib/subtree: Replace invisible carriage return with a visible \\r","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:36:40Z","receivedAt":"2013-03-13T22:36:40Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"On Wed, Mar 13, 2013 at 10:32 PM, Paul Campbell <pcampbell@kemitix.net> wrote:\n> From: Matt Hoffman <matt.hoffman@quantumretail.com>\n>\n> The ctrl-M (^M) character used for the carriage return (CR) is not visible\n> in all (most) text editors and is often silently converted to a new\n> line (NL) or CR/NL combo.\n>\n> 'say' is a wrapper for echo with accepts the option -e to interperet\n> escaped characters. \\r becomes a CR, yet is not munged by text\n> editors.\n>\n> Signed-off-by: Paul Campbell <pcampbell@kemitix.net>\n>\n> Conflicts:\n>         git-subtree.sh\n\nOops. Meant to replace this Conflict line.\n\n> ---\n>  contrib/subtree/git-subtree.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index 2d9b071..5314bd0 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -595,7 +595,7 @@ cmd_split()\n>         eval \"$grl\" |\n>         while read rev parents; do\n>                 revcount=$(($revcount + 1))\n> -               say -n \"$revcount/$revmax ($createcount)\n> \"\n> +               say -ne \"$revcount/$revmax ($createcount)\\r\"\n>                 debug \"Processing commit: $rev\"\n>                 exists=$(cache_get $rev)\n>                 if [ -n \"$exists\" ]; then\n> --\n> 1.8.2\n>\n\n\n\n-- \nPaul [W] Campbell\n"},{"id":"211263","messageId":"1363214554-4490-1-git-send-email-pcampbell@kemitix.net","threadId":"33175","inReplyTo":"CALeLG_kSye2xRoUJ8ytjx-bsj6oSG_brPbj-X3yfXuLA-KEppA@mail.gmail.com","subject":"[PATCH] contrib/subtree: Replace invisible carriage return with a visible \\r","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-13T22:42:34Z","receivedAt":"2013-03-13T22:42:34Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"From: Matt Hoffman <matt.hoffman@quantumretail.com>\n\nThe ctrl-M (^M) character used for the carriage return (CR) is not visible\nin all (most) text editors and is often silently converted to a new\nline (NL) or CR/NL combo.\n\n'say' is a wrapper for echo with accepts the option -e to interperet\nescaped characters. \\r becomes a CR, yet is not munged by text\neditors.\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n\nRerolled with the Conflicts lines removed.\n\n contrib/subtree/git-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 2d9b071..5314bd0 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -595,7 +595,7 @@ cmd_split()\n \teval \"$grl\" |\n \twhile read rev parents; do\n \t\trevcount=$(($revcount + 1))\n-\t\tsay -n \"$revcount/$revmax ($createcount)\n\"\n+\t\tsay -ne \"$revcount/$revmax ($createcount)\\r\"\n \t\tdebug \"Processing commit: $rev\"\n \t\texists=$(cache_get $rev)\n \t\tif [ -n \"$exists\" ]; then\n-- \n1.8.2\n"},{"id":"211268","messageId":"874ngebsm9.fsf@catnip.gol.com","threadId":"33175","inReplyTo":"1363213963-4065-1-git-send-email-pcampbell@kemitix.net","subject":"Re: [PATCH 0/4] contrib/subtree: general updates","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2013-03-14T02:52:14Z","receivedAt":"2013-03-14T02:52:14Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Paul Campbell <pcampbell@kemitix.net> writes:\n> James and Michael's patches add if clauses that use the\n> bashism 'if []' rather than 'if test'.\n\n\"Bashism\"...?  I dunno how portable is, but \"[\" is an old unix alias\nfor \"test\" ... it certainly predates bash...\n\n-miles\n\n-- \nOccam's razor split hairs so well, I bought the whole argument!\n"},{"id":"211269","messageId":"7vvc8uzmht.fsf@alter.siamese.dyndns.org","threadId":"33175","inReplyTo":"874ngebsm9.fsf@catnip.gol.com","subject":"Re: [PATCH 0/4] contrib/subtree: general updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-14T03:30:38Z","receivedAt":"2013-03-14T03:30:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miles Bader <miles@gnu.org> writes:\n\n> Paul Campbell <pcampbell@kemitix.net> writes:\n>> James and Michael's patches add if clauses that use the\n>> bashism 'if []' rather than 'if test'.\n>\n> \"Bashism\"...?  I dunno how portable is, but \"[\" is an old unix alias\n> for \"test\" ... it certainly predates bash...\n\nCorrect. [[ ... ]] is new and spelling out \"test\" indeed is more\ntraditionalist than [ ... ], but for contrib/subtree/ that does not\nwork with anything but bash, I do not think such a rewrite has much\nmerit in the first place.  Being consistently \"bash script\" (as\nopposed to being old-style) is more appropriate for it.\n"},{"id":"212063","messageId":"CALeLG_nPM4TYGAZi0mj7tGSz1hnHQXUUtwhyfodsidR2HZ_VxA@mail.gmail.com","threadId":"33175","inReplyTo":"7vvc8uzmht.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/4] contrib/subtree: general updates","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-03-24T00:16:18Z","receivedAt":"2013-03-24T00:16:18Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"On Thu, Mar 14, 2013 at 3:30 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Miles Bader <miles@gnu.org> writes:\n>\n>> Paul Campbell <pcampbell@kemitix.net> writes:\n>>> James and Michael's patches add if clauses that use the\n>>> bashism 'if []' rather than 'if test'.\n>>\n>> \"Bashism\"...?  I dunno how portable is, but \"[\" is an old unix alias\n>> for \"test\" ... it certainly predates bash...\n>\n> Correct. [[ ... ]] is new and spelling out \"test\" indeed is more\n> traditionalist than [ ... ], but for contrib/subtree/ that does not\n> work with anything but bash, I do not think such a rewrite has much\n> merit in the first place.  Being consistently \"bash script\" (as\n> opposed to being old-style) is more appropriate for it.\n>\n>\n\nDoes no-one have any other comments about these patches?\n\n-- \nPaul [W] Campbell\n"}]}