A way to determine who created a branch in Stash?

Thomas Ferrell August 10, 2014

I was wondering if there is a way to determine who created a branch in Stash? Is it even in the logs somewhere on the server?

3 answers

0 votes
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2014

Hi again Thomas,

Unfortunately Stash won't log branches created or deleted via the UI at the moment. But that seems like a very reasonable feature request. I'd raise an issue in the Stash project at https://jira.atlassian.com to get this implemented.

cheers,

Tim

0 votes
Thomas Ferrell August 20, 2014

Okay, I gave this a try. I see the log happening when I do a push from my client to the server, but what if I utilize the create branch feature directly in Stash itself? I don't see a log happening for that scenario.

0 votes
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2014

Hi Thomas,

If you set the audit.highest.priority.to.log property in your stash-config.properties file to LOW you'll start seeing RepositoryPushEvent entries showing up in your STASH_HOME/log/audit logs. A delete will show a branch ref being updated to the value 0000000000000000000000000000000000000000 (which is the Git SHA equivalent of a null pointer). For example, here's me deleting a branch from the ~admin/ac-test personal repository:

0:0:0:0:0:0:0:1 | RepositoryPushEvent | admin | 1407789777956 | ~ADMIN/ac-test | [{"ref":"refs/heads/guilt-experiment","from":"b20469c9cc95305b24c229d64d2f11aa516bc975","to":"0000000000000000000000000000000000000000"}] | 822x103x0 | cxjlk0

This shows that the user "admin" deleted the branch "guilt-experiment" from the repository "~admin/ac-test" at 1407789777956 milliseconds past epoch.

You can find a full list of Stash audit log events here: https://confluence.atlassian.com/display/STASH/Audit+events+in+Stash

cheers,

Tim

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2014

Ah, I misread your question as "who deleted a branch". A branch creation would look the same as above except the "from" field will show the value "0000000000000000000000000000000000000000" and the "to" field will show the SHA of the branch's head commit.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events