Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As illustrated by <a href="http://kerneltrap.org/mailarchive/git/2008/7/8/2391314" rel="nofollow noreferrer">this thread</a>, you can have hooks on the Subversion side which can actually reject your <code>git svn dcommit</code> based on some criteria.</p> <p>But if you need git hooks on the Git side, I would recommend setting up an intermediate <a href="https://stackoverflow.com/questions/1830701/how-do-i-check-if-a-repository-is-bare/1830712#1830712"><em>bare</em> Git repository</a> (bare for easy push/pull).<br> On that bare repo, you can have any hook you need, as shown in "<a href="https://stackoverflow.com/questions/1464188/how-do-i-deploy-multiple-branches-to-different-directories-via-git-push/1464252#1464252">how do I deploy multiple branches to different directories via git push?</a>" (not about svn but just here to detail a similar setup of an extra repo)</p> <ul> <li>if the intermediate repo validate your push, it could trigger the <code>git svn dcommit</code>.</li> <li>it can also, on a <code>git fetch</code> request, trigger a <code>git svn fetch</code> and validate it, before allowing your own <code>git fetch</code> to move forward.</li> </ul> <hr> <p>(2 years later)</p> <p><a href="http://stackexchange.com/users/86429">David Souther</a> proposes a solution in <a href="http://davidsouther.com/2012/04/git-svn-dcommit-hooks/" rel="nofollow noreferrer">his blog</a> (April 2012)</p> <blockquote> <p>The solution I have is to have a repository with split heads. Most of the time, the intermediate repository will have an empty working directory. When a push happens, it will check out master, verify the build, and push to svn, before returning to the empty branch. </p> <p>We’re going to set up an intermediate git repo with two branches.</p> <ul> <li>master will still point to the SVN repo, </li> <li>and the new branch <code>stage</code> will let us keep the working directory clean and in sync with downstream changes.</li> </ul> </blockquote> <p>Check out <a href="https://gist.github.com/8dfc6575f4d3a293be7c" rel="nofollow noreferrer">his gist</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload