├── Commands ├── git_branch_name.sh ├── git_cherry_pick_no_commit.sh ├── git_rebase.sh └── git_stats.sh ├── LICENSE └── README.md /Commands/git_branch_name.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows current commit branch name 4 | # Created by Michał Zaborowski on 29.11.2013. 5 | # Copyright (c) 2013 Michał Zaborowski. All rights reserved. 6 | 7 | result=$(git branch --contains $1) 8 | echo "Commit SHA1: $1" 9 | echo "Branch name: $result" 10 | -------------------------------------------------------------------------------- /Commands/git_cherry_pick_no_commit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Cherry-picks without commiting changes immediately 4 | # Created by Szymon Anusiewicz on 15.01.2014. 5 | 6 | result=$(git cherry-pick -n $1) 7 | echo "$result" 8 | -------------------------------------------------------------------------------- /Commands/git_rebase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Rebase current commit branch 4 | # Created by Michał Zaborowski on 29.11.2013. 5 | # Copyright (c) 2013 Michał Zaborowski. All rights reserved. 6 | 7 | branch_name=$(git branch --contains $1) 8 | result=$(git rebase $branch_name) 9 | echo result -------------------------------------------------------------------------------- /Commands/git_stats.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last commit diff stats 4 | # Created by Michał Zaborowski on 29.11.2013. 5 | # Copyright (c) 2013 Michał Zaborowski. All rights reserved. 6 | 7 | result=$(git diff --stat HEAD^..HEAD) 8 | echo "$result" 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Michał Zaborowski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sourcetree-custom-actions 2 | 3 | A collection of SourceTree CustomActions. 4 | 5 | ## General 6 | The CustomActions of SourceTree are stored at `~/Library/Application Support/SourceTree/actions.plist`. 7 | 8 | ## How To Use 9 | Copy bash script to `~/Library/Application Support/SourceTree/` 10 | 11 | Go to `SourceTree -> Preferences -> Custom Actions -> Add` and fill custom action with parameters: 12 | 13 | Menu Caption: `Branch Name` 14 | 15 | `+ Show Full Output` 16 | 17 | Script to run: `~/Library/Application Support/SourceTree/branch_name.sh` 18 | 19 | Parameters: `$SHA` 20 | 21 | ## License 22 | Feel free to use it. --------------------------------------------------------------------------------