Notifications fail to be sent when using SubGit SVN Importer
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Notification messages fail to be sent when using the 2.0 EAP SVN Importer for Bitbucket Server.
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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.
Was this helpful?