Skip to content

Commit

Permalink
Avoid using master in favor of main everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Jul 5, 2024
1 parent 0ad4a9a commit 3f568cf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Unreleased

# v1.9.3

- Fix: use main branch in `git-merged` (instead of hardcoding `master`)

# v1.9.2

- `git-shatter-by-file` will still work when there are "skipped" files
- Various internal shell script improvements

# v1.9.1

- `git-main-branch` will now also recognize `mainline` as a main branch name,
Expand Down
10 changes: 8 additions & 2 deletions git-merged
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu
usage () {
echo "usage: git merged [-uh] [<branch>]" >&2
echo >&2
echo "Shows what local branches have been merged into branch (defaults to master)." >&2
echo "Shows what local branches have been merged into branch (defaults to main branch)." >&2
echo >&2
echo "Options:" >&2
echo "-u Show unmerged branches instead of merged branches" >&2
Expand All @@ -26,5 +26,11 @@ else
opts="--merged"
fi

base="${1-master}"
if [ $# -gt 0 ]; then
base="$1"
shift 1
else
base="$(git main-branch)"
fi

git branch $opts "$base" | cut -c3- | grep -vxF "$base"
2 changes: 1 addition & 1 deletion git-spinoff
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ usage () {
echo "previously current branch is not touched." >&2
echo >&2
echo "This is useful to create a feature branch after work has already" >&2
echo "began on the old branch (likely but not necessarily \"master\")." >&2
echo "began on the old branch (likely but not necessarily \"main\")." >&2
echo >&2
echo "Options:" >&2
echo "-h Show this help" >&2
Expand Down

0 comments on commit 3f568cf

Please sign in to comment.