Notifications fail to be sent when using SubGit SVN Importer

Miscellaneous

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Notification messages fail to be sent when using the 2.0 EAP SVN Importer for Stash.

 

Cause

This bug was submitted to tmate: http://issues.tmatesoft.com/issue/SGT-706

We've found a bug in SubGit that causes the problem.

Workaround

The instructions are located here:


Find 'abs_path' function in GIT_REPO/hooks/pre-receive and GIT_REPO/hooks/post-receive hooks, it looks like this:

 

# computes absolute path from relative.
function abs_path() {
  local FILE="$1"
  local RESULT="$2"
  FILE="${FILE%/}"
  local file_basename="${FILE##*/}"

  local DC="${FILE%$file_basename}"

  if [ "x$DC" != "x" ]; then
    cd "$DC"
  fi
  local fileap="$(pwd -P)"
  local ap_with_basename="$fileap/$file_basename"
  cd "-" &>/dev/null

  APFN="${ap_with_basename}"
  eval $RESULT="'$APFN'"
}

 


And change this function as follows: add pushd call in the beginning of the function and popd call at the end of it:

 

# computes absolute path from relative.
function abs_path() {
  pushd $PWD &>/dev/null
  local FILE="$1"
  local RESULT="$2"
  FILE="${FILE%/}"
  local file_basename="${FILE##*/}"

  local DC="${FILE%$file_basename}"

  if [ "x$DC" != "x" ]; then
    cd "$DC"
  fi
  local fileap="$(pwd -P)"
  local ap_with_basename="$fileap/$file_basename"
  cd "-" &>/dev/null

  APFN="${ap_with_basename}"
  eval $RESULT="'$APFN'"
  popd &>/dev/null
}

 


Update all the repositories SubGit is installed into this way and notifications should work fine.

Resolution

 From tmate:
I've just published an interim build with the fix at http://subgit.com/interim/SGT-706/

Feel free to use this version for new repositories; you may upgrade existing repositories to this version as well. We'll include the fix into next EAP/RC build.
Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.