Skip to content

Add Prefix Option https://github.com/ingydotnet/git-subrepo/issues/319 #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/git-subrepo
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ F,fetch Fetch the upstream content first
M,method= Method when you join, valid options are 'merge' or 'rebase'
Default is 'merge'
m,message= Specify a commit message
p,prefix= Specify a prefix for any commit message
r,remote= Specify the upstream remote to push/pull/fetch
s,squash Squash commits on push
u,update Add the --branch and/or --remote overrides to .gitrepo
Expand Down Expand Up @@ -123,9 +124,10 @@ main() {

local override_remote= # Remote specified with -r
local override_branch= # Remote specified with -b

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this extra white space.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ;)

local edit_wanted=false # Edit commit message using -e
local wanted_commit_message= # Custom commit message using -m
local prefix_commit_message= # Custom commit prefix message using -p

local join_method= # Current join method (rebase/merge)

Expand Down Expand Up @@ -1011,6 +1013,8 @@ get-command-options() {
-F) fetch_wanted=true ;;
-m) wanted_commit_message="$1"
shift;;
-p) prefix_commit_message="$1"
shift;;
-M) join_method="$1"
shift;;
-M) join_method="$1"
Expand Down Expand Up @@ -1578,7 +1582,7 @@ get-commit-message() {

# Format subrepo commit message:
cat <<...
git subrepo $command$is_merge ${args[@]}
${prefix_commit_message}git subrepo $command$is_merge ${args[@]}

subrepo:
subdir: "$subdir"
Expand Down