Skip to content

Develop#102

Open
ChrisJStone wants to merge 19 commits intoCJ-Systems:legacy-developfrom
LBEM-CH:develop
Open

Develop#102
ChrisJStone wants to merge 19 commits intoCJ-Systems:legacy-developfrom
LBEM-CH:develop

Conversation

@ChrisJStone
Copy link
Member

No description provided.

konsdibons and others added 19 commits December 12, 2025 19:14
- Add sync command to feature/bugfix (like git-town sync)
- Add propose command to feature/bugfix (create PR/MR)
- Add config export command to write .gitflow file
- Add .gitflow file support for shared team settings
- Add finish mode (classic/propose/ask) configuration
- Add sync strategy (rebase/merge) configuration
- Add forge detection (GitHub, GitLab, Bitbucket)
- Add short flags for macOS BSD getopt compatibility
- Add LBEM copyright headers
Triggers repository_dispatch to homebrew-gitflow-lbem repo when a
version tag (v*) is pushed, enabling automatic formula updates.
LBEM Edition Enhancements:

Propose command improvements:
- Add --draft/-d flag to create draft PRs
- Add --assignee/-a flag to set PR assignees
- Add --reviewer/-R flag to request reviewers
- Add --label/-l flag to add PR labels
- Add autolabel support (auto-add branch type as label)
- Add 'pr' alias for propose command (git flow feature pr)
- All propose flags support config defaults

Sync command improvements:
- Add --prune flag to clean up stale local branches
- Prune safely skips branches with unpushed local commits
- Add cmd_sync to release and hotfix branches
- Add top-level 'git flow sync' shortcut

Release/Hotfix finish improvements:
- Add --create-release/-9 flag to create GitHub/GitLab releases
- Uses gh/glab CLI tools for release creation
- Supports config default via gitflow.release.finish.create-release

Safety improvements:
- Feature/bugfix finish detects GitHub-merged branches
- Safely cleans up local branch when remote was merged via web UI
- Prune protects branches with unpushed commits

Init improvements:
- Add LBEM Edition settings section
- Configure draft PRs, create-release, sync prune defaults

New configuration options:
- gitflow.feature.propose.draft
- gitflow.feature.propose.assignee
- gitflow.feature.propose.reviewer
- gitflow.feature.propose.labels
- gitflow.feature.propose.autolabel
- gitflow.bugfix.propose.* (same as feature)
- gitflow.release.finish.create-release
- gitflow.hotfix.finish.create-release
- gitflow.sync.prune
The closing brace of cmd_default() was concatenated with cmd_help()
resulting in '}cmd_help()' which caused a 'Bad function name' syntax
error when running with /bin/sh (dash) on Linux systems.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc6351f3c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


# allow user to request git action logging
DEFINE_boolean 'showcommands' false 'Show actions taken (git commands)'
DEFINE_boolean 'showcommands' false 'Show actions taken (git commands)' s

Choose a reason for hiding this comment

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

P1 Badge Remove conflicting -s alias from global showcommands

Defining top-level showcommands with short flag -s collides with subcommands that already use -s (for example release finish --sign and hotfix finish --sign). In shFlags, this duplicate short name causes the later flag definition to be skipped, which leads to runtime errors like [: -eq: unexpected operator when those commands call flag sign, and can silently break sign-related behavior.

Useful? React with 👍 / 👎.

Comment on lines +142 to +144
git fetch -q origin || { echo "Could not fetch from origin."; exit 1; }
if git rev-parse --verify "origin/${_current_branch}" >/dev/null 2>&1; then
git merge --ff-only "origin/${_current_branch}" || { echo "Could not fast-forward '${_current_branch}'. You may need to merge manually."; exit 1; }

Choose a reason for hiding this comment

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

P2 Badge Use configured origin for develop/master sync path

The new top-level sync fast-path hardcodes origin instead of using the configured git-flow remote (gitflow.origin / $ORIGIN). In repositories that intentionally use a different remote name (e.g., upstream), git flow sync on develop/master fails immediately with fetch errors even though the repo is correctly configured.

Useful? React with 👍 / 👎.

Comment on lines +471 to +473
if [ "$answer" = "merge" ] || [ "$answer" = "rebase" ]; then
git_do config $gitflow_config_option gitflow.feature.finish.mode "$answer"
else

Choose a reason for hiding this comment

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

P2 Badge Write compatible values to feature finish mode config

Init now stores gitflow.feature.finish.mode as merge/rebase, but finish-mode consumers validate and expect classic|propose|ask and read the subcommand-specific key first. This means a normal init shadows the global gitflow.finish.mode setting for feature branches, so git flow config set finishmode propose will not take effect for feature finish unless users manually fix config values.

Useful? React with 👍 / 👎.

_gh_opts="$_gh_opts --label \"$_labels\""
fi

eval gh pr create $_gh_opts

Choose a reason for hiding this comment

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

P1 Badge Replace eval-based PR creation with safe argv calls

gitflow_create_pr builds command strings from branch and user-provided fields and executes them with eval. Because ref names and options are interpolated into shell text, crafted values containing quotes or shell metacharacters can break quoting and execute unintended commands when users run feature/bugfix propose; this should be invoked as direct argv without eval.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants