Lines Matching +full:commits +full:-
40 echo "This command squash merges all commits from a given branch into the current branch"
41 …t, the changes are committed with a commit message which includes the list of all squashed commits"
42 echo "(use --no-commit and --no-list options to change default behavior)."
44 echo "Usage: $(basename "$0") [--no-list] [--no-commit] <branch> [<commit msg>]"
49 echo " --no-list The commit message will not include the list of squashed commits"
50 echo " --no-commit Squash and stage the changes but do not commit "
59 --help | -h | -[?])
64 --no-list)
67 --no-commit)
70 --debug) set -x ;;
71 --*) die "Unknown argument $1" ;;
72 -*) die "Unknown argument $1" ;;
80 if [ "$#" -eq 0 ]; then
85 if [ "$#" -gt 2 ]; then
93 cur_branch=$(git rev-parse --abbrev-ref HEAD)
95 # Get the list of commits (diff between current and new branch)
96 # Note that the list starts with older commits
99 commit_list=$(git log HEAD.."$branch" --oneline --decorate=no --reverse)
106 if [ -z "$2" ]; then
112 git merge --squash "$branch" 1>/dev/null 2>/dev/null || die "Failed to perform 'git merge -squash $…
115 if ! git diff --cached --quiet; then
122 …git commit -m "$commit_msg" 1>/dev/null 2>/dev/null || die "git commit failed${NEWLINE}${NEWLINE}$…
124 git log -1
128 … echo "Successfully prepared squash merge of branch '$branch' into '$cur_branch' - ready to commit"