{"thread":{"id":"28106","subject":"[PATCH v2] git svn : hook before 'git svn dcommit'","startedAt":"2011-08-15T20:04:59Z","lastAt":"2011-09-01T16:58:07Z","messageCount":9,"participants":["Frédéric Heitzmann","Junio C Hamano","Eric Wong","Peter Baumann","Paul Young"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"173552","messageId":"1313438699-9926-1-git-send-email-frederic.heitzmann@gmail.com","threadId":"28106","inReplyTo":null,"subject":"[PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Frédéric Heitzmann","fromEmail":"frederic.heitzmann@gmail.com","sentAt":"2011-08-15T20:04:59Z","receivedAt":"2011-08-15T20:04:59Z","isPatch":true,"sender":{"key":"frederic.heitzmann@gmail.com","avatar":null},"body":"The 'pre-svn-dcommit' hook is called before 'git svn dcommit', which aborts\nif return value is not zero. The only parameter given to the hook is the\nreference given to 'git svn dcommit'. If no paramter was used, hook gets HEAD\nas its only parameter.\n\nSigned-off-by: Frédéric Heitzmann <frederic.heitzmann@gmail.com>\n---\nI resend the same patch previously sent July 9th.\nApparently it did not graduated upstream, and I do not know why.\nPlease someone tell me if something needs to be improved.\n\n Documentation/git-svn.txt |   14 +++++++++++++-\n git-svn.perl              |   21 +++++++++++++++++++++\n 2 files changed, 34 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 713e523..ec87ed3 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -700,6 +700,18 @@ section because they affect the 'git-svn-id:' metadata line, except\n for rewriteRoot and rewriteUUID which can be used together.\n \n \n+HOOKS\n+-----\n+\n+The 'pre-svn-dcommit' hook is called by 'git svn dcommit' and can be used to\n+prevent some diff to be committed to a SVN repository. It may typically be\n+used to filter some intermediate patches, which were committed into git but\n+must not find their way to the SVN repository.\n+\n+It takes a single parameter, the reference given to 'git svn dcommit'. If the\n+hook exists with a non zero-status, 'git svn dcommit' will abort.\n+\n+\n BASIC EXAMPLES\n --------------\n \n@@ -901,7 +913,7 @@ reset) branches-maxRev and/or tags-maxRev as appropriate.\n \n SEE ALSO\n --------\n-linkgit:git-rebase[1]\n+linkgit:git-rebase[1], linkgit:githooks[5]\n \n GIT\n ---\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 89f83fd..a537858 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -396,6 +396,25 @@ sub init_subdir {\n \t$_repository = Git->repository(Repository => $ENV{GIT_DIR});\n }\n \n+sub pre_svn_dcommit_hook {\n+\tmy $head = shift;\n+\n+\tmy $hook = \"$ENV{GIT_DIR}/hooks/pre-svn-dcommit\";\n+\treturn 0 if ! -e $hook || ! -x $hook;\n+\n+\tsystem($hook, $head);\n+\tif ($? == -1) {\n+\t\tprint \"[pre_svn_dcommit_hook] failed to execute $hook: $!\\n\";\n+\t\treturn 1;\n+\t} elsif ($? & 127) {\n+\t\tprintf \"[pre_svn_dcommit_hook] child died with signal %d, %s coredump\\n\",\n+\t\t($? & 127),  ($? & 128) ? 'with' : 'without';\n+\t\treturn 1;\n+\t} else {\n+\t\treturn $? >> 8;\n+\t}\n+}\n+\n sub cmd_clone {\n \tmy ($url, $path) = @_;\n \tif (!defined $path &&\n@@ -505,6 +524,8 @@ sub cmd_dcommit {\n \t\t. \"or stash them with `git stash'.\\n\";\n \t$head ||= 'HEAD';\n \n+\treturn if pre_svn_dcommit_hook($head);\n+\n \tmy $old_head;\n \tif ($head ne 'HEAD') {\n \t\t$old_head = eval {\n-- \n1.7.6.133.gd3b55a\n"},{"id":"173554","messageId":"7vty9ijs1i.fsf@alter.siamese.dyndns.org","threadId":"28106","inReplyTo":"1313438699-9926-1-git-send-email-frederic.heitzmann@gmail.com","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-15T21:14:49Z","receivedAt":"2011-08-15T21:14:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frédéric Heitzmann  <frederic.heitzmann@gmail.com> writes:\n\n> The 'pre-svn-dcommit' hook is called before 'git svn dcommit', which aborts\n> if return value is not zero. The only parameter given to the hook is the\n> reference given to 'git svn dcommit'. If no paramter was used, hook gets HEAD\n> as its only parameter.\n\nIt appears that this is in the same spirit as the pre-commit hook used in\n\"git commit\", so it may not hurt but I do not know if having a separate\nhook is the optimal approach to achieve what it wants to do.\n\nI notice that git-svn users have been happily using the subsystem without\nneed for any hook (not just pre-commit). Does \"git svn\" need an equivalent\nof pre-commit hook? If so, does it need equivalents to other hooks as\nwell? I am not suggesting you to add support for a boatload of other hooks\nin this patch---I am trying to see if this is really a necessary change to\nbegin with.\n\nEric, do you want this one?\n\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 89f83fd..a537858 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -396,6 +396,25 @@ sub init_subdir {\n>  \t$_repository = Git->repository(Repository => $ENV{GIT_DIR});\n>  }\n>  \n> +sub pre_svn_dcommit_hook {\n> +\tmy $head = shift;\n> +\n> +\tmy $hook = \"$ENV{GIT_DIR}/hooks/pre-svn-dcommit\";\n> +\treturn 0 if ! -e $hook || ! -x $hook;\n\nWhy force two stat(), instead of just \"if ! -x $hook\"?  Doesn't it respond\nto a non-existing $hook with \"there is nothing executable there\" just fine?\n\n> +\tsystem($hook, $head);\n> +\tif ($? == -1) {\n> +\t\tprint \"[pre_svn_dcommit_hook] failed to execute $hook: $!\\n\";\n> +\t\treturn 1;\n> +\t} elsif ($? & 127) {\n> +\t\tprintf \"[pre_svn_dcommit_hook] child died with signal %d, %s coredump\\n\",\n> +\t\t($? & 127),  ($? & 128) ? 'with' : 'without';\n> +\t\treturn 1;\n> +\t} else {\n> +\t\treturn $? >> 8;\n> +\t}\n> +}\n\nShould these messages go to the standard output?\n\n>  sub cmd_clone {\n>  \tmy ($url, $path) = @_;\n>  \tif (!defined $path &&\n> @@ -505,6 +524,8 @@ sub cmd_dcommit {\n>  \t\t. \"or stash them with `git stash'.\\n\";\n>  \t$head ||= 'HEAD';\n>  \n> +\treturn if pre_svn_dcommit_hook($head);\n> +\n>  \tmy $old_head;\n>  \tif ($head ne 'HEAD') {\n>  \t\t$old_head = eval {\n"},{"id":"173651","messageId":"20110817003023.GA30153@dcvr.yhbt.net","threadId":"28106","inReplyTo":"7vty9ijs1i.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2011-08-17T00:30:23Z","receivedAt":"2011-08-17T00:30:23Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Frédéric Heitzmann  <frederic.heitzmann@gmail.com> writes:\n> \n> > The 'pre-svn-dcommit' hook is called before 'git svn dcommit', which aborts\n> > if return value is not zero. The only parameter given to the hook is the\n> > reference given to 'git svn dcommit'. If no paramter was used, hook gets HEAD\n> > as its only parameter.\n> \n> It appears that this is in the same spirit as the pre-commit hook used in\n> \"git commit\", so it may not hurt but I do not know if having a separate\n> hook is the optimal approach to achieve what it wants to do.\n> \n> I notice that git-svn users have been happily using the subsystem without\n> need for any hook (not just pre-commit). Does \"git svn\" need an equivalent\n> of pre-commit hook? If so, does it need equivalents to other hooks as\n> well? I am not suggesting you to add support for a boatload of other hooks\n> in this patch---I am trying to see if this is really a necessary change to\n> begin with.\n> \n> Eric, do you want this one?\n\nI'm not sure.  I feel hooks should be avoided whenever possible, and\na git-svn-specific hook for dcommit wouldn't place the same restriction\nas a server-side SVN hook for svn(1) users.\n\nPreventing certain commits from accidentally hitting the SVN server can\nbe useful, I think.  On the other hand, I'm not sure if people who run\naccidental dcommits would remember to the pre-dcommit hook, either.\n\nPerhaps an interactive option for dcommit would be just as useful?\n\nTest cases are required for any new features of git-svn, though.\n\n> > +\tsystem($hook, $head);\n> > +\tif ($? == -1) {\n> > +\t\tprint \"[pre_svn_dcommit_hook] failed to execute $hook: $!\\n\";\n> > +\t\treturn 1;\n> > +\t} elsif ($? & 127) {\n> > +\t\tprintf \"[pre_svn_dcommit_hook] child died with signal %d, %s coredump\\n\",\n> > +\t\t($? & 127),  ($? & 128) ? 'with' : 'without';\n> > +\t\treturn 1;\n> > +\t} else {\n> > +\t\treturn $? >> 8;\n> > +\t}\n> > +}\n> \n> Should these messages go to the standard output?\n\nFailure messages should definitely go to stderr.\n\n-- \nEric Wong\n"},{"id":"173675","messageId":"CALeToSUidWgiJ+PxuphnBZOQGNStNOO9==EswfLDpFr2GYy=nA@mail.gmail.com","threadId":"28106","inReplyTo":"CALeToSWJNK=q4iPwxNvgGin0T61oLKJd=b9F3cSSo0vVebrhhQ@mail.gmail.com","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Frédéric Heitzmann","fromEmail":"frederic.heitzmann@gmail.com","sentAt":"2011-08-17T14:35:03Z","receivedAt":"2011-08-17T14:35:03Z","isPatch":true,"sender":{"key":"frederic.heitzmann@gmail.com","avatar":null},"body":"Hi all.\n\nMaybe I should give some more context to explain why a hook could be a\npotential improvement.\n\nLet's consider the following workflow :\n1) git svn clone from the SVN server, then git checkout -b topic\n2) git commit some \"reference data\", before starting some optimization\nor code refactoring.\n** These reference data are not supposed to find their way to the SVN server **\nCommitting such \"reference data\" is just a convenience because git\ndoes a great job to show how these data may or may not change during\nthe development process.\n3) hack, test, commit ...\n3 bis) it may happen that reference data change for some very good\nreason (for instance some protocol change)\nNew reference data are then commited.\n\nback to 3 ...\n\n4) Before merging back to master and commitng to SVN, it is necessary\nto remove commits with reference data (git rebase -i --onto master\nmaster topic ...)\n5) merge topic branch with master and git svn dcommit\n\n-- end --\n\nIt is very easy to forget step 4, and svn commit lots of useless data.\n\nProposal 1)\n* commit reference data with some specific mark in the commit message\n(e.g. \"NO_SVN\")\n* use pre-svn-dcommit hook to detect such commits\n\nProposal 2) (not fully feasable for what I know)\n* git svn clone to a bare repo\n* clone a working repo from the the bare repo.\n* steps 2, 3, maybe 3bis, ... then 4\n* push commits to the bare repo, while using pre-receive or update\nhook to look for wrong commits, and abort if so.\n* use post-receive hook to trigger git svn dcommit\n\nMain drawback for proposal 2 (appart from needing 2 repo instead of\none) is that each time you want to update your working  repo, you have\nto git svn rebase the bare repo, then git pull.\n\nProposal 2bis)\n* add a pre-send hook on the bare repo, and trigger some git svn\nrebase with this hook.\nI am not sure to see all the potential consequences of such a hook though.\n\nAll things begin equal, proposal 1 seems to be the easier path, but it\nis highly debatable.\n\n--\nFred\n\nps : I had to resend this email because first attempt included HTML\n(sic). Very sorry if you receive it twice.\n\n2011/8/17 Eric Wong <normalperson@yhbt.net>\n>\n> Junio C Hamano <gitster@pobox.com> wrote:\n> > Frédéric Heitzmann  <frederic.heitzmann@gmail.com> writes:\n> >\n> > > The 'pre-svn-dcommit' hook is called before 'git svn dcommit', which aborts\n> > > if return value is not zero. The only parameter given to the hook is the\n> > > reference given to 'git svn dcommit'. If no paramter was used, hook gets HEAD\n> > > as its only parameter.\n> >\n> > It appears that this is in the same spirit as the pre-commit hook used in\n> > \"git commit\", so it may not hurt but I do not know if having a separate\n> > hook is the optimal approach to achieve what it wants to do.\n> >\n> > I notice that git-svn users have been happily using the subsystem without\n> > need for any hook (not just pre-commit). Does \"git svn\" need an equivalent\n> > of pre-commit hook? If so, does it need equivalents to other hooks as\n> > well? I am not suggesting you to add support for a boatload of other hooks\n> > in this patch---I am trying to see if this is really a necessary change to\n> > begin with.\n> >\n> > Eric, do you want this one?\n>\n> I'm not sure.  I feel hooks should be avoided whenever possible, and\n> a git-svn-specific hook for dcommit wouldn't place the same restriction\n> as a server-side SVN hook for svn(1) users.\n>\n> Preventing certain commits from accidentally hitting the SVN server can\n> be useful, I think.  On the other hand, I'm not sure if people who run\n> accidental dcommits would remember to the pre-dcommit hook, either.\n>\n> Perhaps an interactive option for dcommit would be just as useful?\n>\n> Test cases are required for any new features of git-svn, though.\n>\n> > > +   system($hook, $head);\n> > > +   if ($? == -1) {\n> > > +           print \"[pre_svn_dcommit_hook] failed to execute $hook: $!\\n\";\n> > > +           return 1;\n> > > +   } elsif ($? & 127) {\n> > > +           printf \"[pre_svn_dcommit_hook] child died with signal %d, %s coredump\\n\",\n> > > +           ($? & 127),  ($? & 128) ? 'with' : 'without';\n> > > +           return 1;\n> > > +   } else {\n> > > +           return $? >> 8;\n> > > +   }\n> > > +}\n> >\n> > Should these messages go to the standard output?\n>\n> Failure messages should definitely go to stderr.\n>\n> --\n> Eric Wong\n"},{"id":"173694","messageId":"20110817203701.GB24581@dcvr.yhbt.net","threadId":"28106","inReplyTo":"CALeToSUidWgiJ+PxuphnBZOQGNStNOO9==EswfLDpFr2GYy=nA@mail.gmail.com","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2011-08-17T20:37:01Z","receivedAt":"2011-08-17T20:37:01Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Frédéric Heitzmann <frederic.heitzmann@gmail.com> wrote:\n> 4) Before merging back to master and commitng to SVN, it is necessary\n> to remove commits with reference data (git rebase -i --onto master\n> master topic ...)\n> 5) merge topic branch with master and git svn dcommit\n> \n> -- end --\n> \n> It is very easy to forget step 4, and svn commit lots of useless data.\n\nI agree.\n\n> Proposal 1)\n> * commit reference data with some specific mark in the commit message\n> (e.g. \"NO_SVN\")\n> * use pre-svn-dcommit hook to detect such commits\n\nThe problem with this is hook standardization across committers and even\nacross different machines/directories a committer may use.\n\n> Proposal 2) (not fully feasable for what I know)\n> * git svn clone to a bare repo\n> * clone a working repo from the the bare repo.\n> * steps 2, 3, maybe 3bis, ... then 4\n> * push commits to the bare repo, while using pre-receive or update\n> hook to look for wrong commits, and abort if so.\n> * use post-receive hook to trigger git svn dcommit\n> \n> Main drawback for proposal 2 (appart from needing 2 repo instead of\n> one) is that each time you want to update your working  repo, you have\n> to git svn rebase the bare repo, then git pull.\n\nProposal 2 is way too complicated, I hate it.\n\n> All things begin equal, proposal 1 seems to be the easier path, but it\n> is highly debatable.\n\nI had Proposal 3 in my original response:\n\n> 2011/8/17 Eric Wong <normalperson@yhbt.net> wrote:\n> > Perhaps an interactive option for dcommit would be just as useful?\n\n1 and 3 can both implemented, but I think 3 would be easier to\nuse/setup/standardize.  I suspect it's also easier to train oneself to\nalways use \"dcommit -i\".  Perhaps even default to interactive mode\nlike git-send-email does nowadays.\n\nUnfortunately interactive dcommit requires more effort to implement.\n\n-- \nEric Wong\n"},{"id":"173743","messageId":"20110818091228.GB16549@m62s10.vlinux.de","threadId":"28106","inReplyTo":"CALeToSUidWgiJ+PxuphnBZOQGNStNOO9==EswfLDpFr2GYy=nA@mail.gmail.com","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2011-08-18T09:12:28Z","receivedAt":"2011-08-18T09:12:28Z","isPatch":true,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Wed, Aug 17, 2011 at 04:35:03PM +0200, Frédéric Heitzmann wrote:\n> Hi all.\n> \n> Maybe I should give some more context to explain why a hook could be a\n> potential improvement.\n> \n> Let's consider the following workflow :\n> 1) git svn clone from the SVN server, then git checkout -b topic\n> 2) git commit some \"reference data\", before starting some optimization\n> or code refactoring.\n> ** These reference data are not supposed to find their way to the SVN server **\n> Committing such \"reference data\" is just a convenience because git\n> does a great job to show how these data may or may not change during\n> the development process.\n> 3) hack, test, commit ...\n> 3 bis) it may happen that reference data change for some very good\n> reason (for instance some protocol change)\n> New reference data are then commited.\n> \n> back to 3 ...\n> \n> 4) Before merging back to master and commitng to SVN, it is necessary\n> to remove commits with reference data (git rebase -i --onto master\n> master topic ...)\n> 5) merge topic branch with master and git svn dcommit\n> \n> -- end --\n> \n> It is very easy to forget step 4, and svn commit lots of useless data.\n> \n> Proposal 1)\n> * commit reference data with some specific mark in the commit message\n> (e.g. \"NO_SVN\")\n> * use pre-svn-dcommit hook to detect such commits\n> \n> Proposal 2) (not fully feasable for what I know)\n> * git svn clone to a bare repo\n> * clone a working repo from the the bare repo.\n> * steps 2, 3, maybe 3bis, ... then 4\n> * push commits to the bare repo, while using pre-receive or update\n> hook to look for wrong commits, and abort if so.\n> * use post-receive hook to trigger git svn dcommit\n> \n> Main drawback for proposal 2 (appart from needing 2 repo instead of\n> one) is that each time you want to update your working  repo, you have\n> to git svn rebase the bare repo, then git pull.\n> \n> Proposal 2bis)\n> * add a pre-send hook on the bare repo, and trigger some git svn\n> rebase with this hook.\n> I am not sure to see all the potential consequences of such a hook though.\n> \n> All things begin equal, proposal 1 seems to be the easier path, but it\n> is highly debatable.\n> \n\nI have written a local script for exactly the problem you described after looking\nfor a git svn dcommit hook I could use (as you did).\nI attached it, so feel free to use it. Simply add it to your bin and run it\nwith   git dcommit    instead of  git svn dcommit\n\nPls read the comment for further explanation how this script is used.\n\n\n#!/bin/bash\n# Copyright © Peter Baumann, 2011\n#\n# Wrapper script around git svn dcommit, which adds some useful functionality\n#\n# This script will prevent accidentally commiting some commits not yet ready\n# into SVN. Commits starting with (case insensitive) debug, wip, fixup are\n# considered not appropriate for putting them into SVN. The main reason for\n# this functionality is the specific workflow I use. I always have some \n# internal debug commits (e.g. enhanced debug logging) or simply work in progress\n# commits which should never be put into SVN. \n#\n# To avoid putting those into SVN, I rebase all commits so that my WIP/DEBUG commits \n# are on top of the commits ment for SVN.\n# Calling this script via \"git dcommit\" after the rebase makes sure only commits\n# beneath the WIP commits are considered for SVN. \n# Furthermore, a shortlog of commits ment for SVN is shown and the user has\n# to confirm before actually putting them into SVN.\n#\n# If this script is called via a specific commit (e.g. via its SHA1) as parameter,\n# then only commits beneath and including the commit itself are committet to SVN.\n\n\nSUBDIRECTORY_OK=Yes\n\n. git-sh-setup\nrequire_work_tree\ncd_to_toplevel || die \"foo\"\n\n# Upstream ref\nupstream=remotes/trunk\n\n# Stop at this commit\nlast=\nif [ ! -z $1 ]; then\n\t$(git rev-parse $1^{commit})\n\techo $last\nfi\n\n# The latest git commit we want to commit SVN\ncommit=\n\n# Remembers the original head\norig_head=\nif branch=$(git symbolic-ref -q HEAD)\nthen\n\torig_head=${branch#refs/heads/}\nelse\n\torig_head='(detached head)'\nfi\n\n\nfunction run()\n{\n\t#echo \"DEBUG: $@\"\n\t$@\n}\t\n\nIFS='\n'\nfor c in $(git log --reverse --pretty=\"%H %s\" HEAD --not \"${upstream}\"); do\n\t# Split the log output into its fields\n\tsha1=\"${c:0:40}\"\n\tmsg=\"${c:41}\"\n\n\t# Check if the commit subject matches (case insenstive) to one of the\n\t# following patterns. Leading whitespace is fine\n\t# \tdebug\n\t#\twip\n\t#\tfixup!\n\tif echo \"$msg\"|egrep -i -q '^\\s*(debug|wip|fixup)'; then\n\t\tbreak\n\tfi\n\tcommit=${sha1}\n\n\tif [ \"x${commit}\" = \"x${last}\" ]; then\n\t\tbreak\n\tfi\ndone\n\n\nif [ \"x${commit}\" == \"x\" ]; then\n\tdie \"Nothing to commit - Perhaps you have only stuff not ready for SVN?\"\nfi\n\necho \">>>> Committing the folling GIT commits to SVN <<<<\"\ngit --no-pager log --pretty=oneline ${commit} --not \"${upstream}\"\necho\n\n# Show the latest commit we are going to submit to SVN\n#git show ${commit}\n\necho\necho \"Commiting to SVN (y/N)?\"\nread yesno || die \"Aborting\"\n\nif [ \"x${yesno}\" == \"xy\" ] || [ \"x$yesno\" == \"xY\" ]; then\n\trun git checkout -q \"${commit}\" || die \"Checkout failed\"\n\trun git svn dcommit || \"Aborting - git svn dcommit failed!\"\n\n\tif [ \"${orig_head}\" != \"(detached head)\" ]; then\n\t\techo \"DO THIS:\"\n\t\trun git checkout \"${orig_head}\" && run git rebase \"${upstream}\"\n\telse\n\t\techo \"You have started this script being on a detached HEAD.\"\n\t\techo \"Please rebase manually!\"\n\tfi\nfi\n"},{"id":"173757","messageId":"CALeToSUUJ4egjU_Pduub4VC+CJ3b2YSvPFEfJikRMsm9w4Ad5w@mail.gmail.com","threadId":"28106","inReplyTo":"20110817203701.GB24581@dcvr.yhbt.net","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Frédéric Heitzmann","fromEmail":"frederic.heitzmann@gmail.com","sentAt":"2011-08-18T13:43:12Z","receivedAt":"2011-08-18T13:43:12Z","isPatch":true,"sender":{"key":"frederic.heitzmann@gmail.com","avatar":null},"body":"2011/8/17 Eric Wong <normalperson@yhbt.net>:\n>> 2011/8/17 Eric Wong <normalperson@yhbt.net> wrote:\n>> > Perhaps an interactive option for dcommit would be just as useful?\n>\n> 1 and 3 can both implemented, but I think 3 would be easier to\n> use/setup/standardize.  I suspect it's also easier to train oneself to\n> always use \"dcommit -i\".  Perhaps even default to interactive mode\n> like git-send-email does nowadays.\n>\n> Unfortunately interactive dcommit requires more effort to implement.\n>\n> --\n> Eric Wong\n\nIt seems that proposal 3 is somehow equivalent to\n$ git rebase -i --onto remotes/trunk remotes/trunk\n... check commits, maybe remove some of them, ...\n$ git svn dcommit\n\nnote : is the SVN remote branch always named \"remote/trunk\" ? If not,\nis there a way to guess its name ?\n\n--\nFred\n"},{"id":"173927","messageId":"20110820184149.GA32688@dcvr.yhbt.net","threadId":"28106","inReplyTo":"CALeToSUUJ4egjU_Pduub4VC+CJ3b2YSvPFEfJikRMsm9w4Ad5w@mail.gmail.com","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2011-08-20T18:41:49Z","receivedAt":"2011-08-20T18:41:49Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Frédéric Heitzmann <frederic.heitzmann@gmail.com> wrote:\n> 2011/8/17 Eric Wong <normalperson@yhbt.net>:\n> >> 2011/8/17 Eric Wong <normalperson@yhbt.net> wrote:\n> >> > Perhaps an interactive option for dcommit would be just as useful?\n> >\n> > 1 and 3 can both implemented, but I think 3 would be easier to\n> > use/setup/standardize.  I suspect it's also easier to train oneself to\n> > always use \"dcommit -i\".  Perhaps even default to interactive mode\n> > like git-send-email does nowadays.\n> >\n> > Unfortunately interactive dcommit requires more effort to implement.\n> \n> It seems that proposal 3 is somehow equivalent to\n> $ git rebase -i --onto remotes/trunk remotes/trunk\n> ... check commits, maybe remove some of them, ...\n> $ git svn dcommit\n\nNo, it would just prompt before making every commit (showing the log\nmessage), like git-send-email can before sending every message.\n\n> note : is the SVN remote branch always named \"remote/trunk\" ? If not,\n> is there a way to guess its name ?\n\ngit svn dcommit --dry-run will print the URL from which you can\ninfer the remote branch.  There might be an easier way, but I\ncan't remember... (I don't see SVN much nowadays, most projects\nI've cared about migrated to git)\n\n-- \nEric Wong\n"},{"id":"174686","messageId":"loom.20110901T185405-97@post.gmane.org","threadId":"28106","inReplyTo":"20110818091228.GB16549@m62s10.vlinux.de","subject":"Re: [PATCH v2] git svn : hook before 'git svn dcommit'","fromName":"Paul Young","fromEmail":"paulyoungonline@gmail.com","sentAt":"2011-09-01T16:58:07Z","receivedAt":"2011-09-01T16:58:07Z","isPatch":true,"sender":{"key":"paulyoungonline@gmail.com","avatar":null},"body":"Hi there\n\nI'm trying to set up a post git svn dcommit hook in order to automatically\ndeliver stories via Pivotal Tracker:\n\nhttps://www.pivotaltracker.com/help/api?version=v3#subversion_post_commit_example\n\nDo you think you could help?\n\nThanks.\n"}]}