Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes problem with egrep on some platforms

  • Loading branch information...
commit 946d79625f3de6926844db6a3aa4f9088f523880 1 parent 16366c7
@petterik petterik authored
View
2  bin/fetch_git_repo_data.sh
@@ -62,7 +62,7 @@ print_hashes_and_git_log_numstat ()
# If there are no indexed commits, get the first commit of the repository.
SINCE_COMMIT=""
- HAS_INDEXED_COMMITS=`$SPLUNK search "index=splunkgit repository=$GIT_REPO sourcetype=git_file_change | head 1 | stats count" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '\d+'`
+ HAS_INDEXED_COMMITS=`$SPLUNK search "index=splunkgit repository=$GIT_REPO sourcetype=git_file_change | head 1 | stats count" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '[0-9]+'`
if [ "$HAS_INDEXED_COMMITS" = "0" ]; then
FIRST_COMMIT=`git log --all --no-color --no-renames --no-merges --reverse --pretty=format:'%H' | head -n 1`
SINCE_COMMIT=$FIRST_COMMIT
View
2  bin/git_repo_messages.sh
@@ -59,7 +59,7 @@ print_commit_message_event ()
commit_messages_search="index=splunkgit repository=$GIT_REPO sourcetype=git_commit_messages | head 1 | stats count"
- HAS_INDEXED_COMMITS=`$SPLUNK search "$commit_messages_search" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '\d+'`
+ HAS_INDEXED_COMMITS=`$SPLUNK search "$commit_messages_search" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '[0-9]+'`
if [ "$HAS_INDEXED_COMMITS" = "0" ]; then
FIRST_COMMIT=`git log --all --no-color --no-renames --no-merges --reverse --pretty=format:'%H' | head -n 1`
SINCE_COMMIT=$FIRST_COMMIT
View
2  bin/git_source_code.sh
@@ -75,7 +75,7 @@ print_source_code ()
commit_messages_search="index=splunkgit repository=$GIT_REPO sourcetype=git_source_code | head 1 | stats count"
- HAS_INDEXED_COMMITS=`$SPLUNK search "$commit_messages_search" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '\d+'`
+ HAS_INDEXED_COMMITS=`$SPLUNK search "$commit_messages_search" -auth $SPLUNK_USERNAME:$SPLUNK_PASSWORD -app $APP_NAME | egrep -o '[0-9]+'`
if [ "$HAS_INDEXED_COMMITS" = "0" ]; then
FIRST_COMMIT=`git log --all --no-color --no-renames --no-merges --reverse --pretty=format:'%H' | head -n 1`
SINCE_COMMIT=$FIRST_COMMIT
Please sign in to comment.
Something went wrong with that request. Please try again.