Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
petrzpav committed Sep 19, 2024
2 parents 3d81ce4 + 8d74699 commit 331be33
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 22 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.0] - 2024-09-19

_Stable release based on [3.1.0-rc.1]._

## [3.1.0-rc.1] - 2024-09-19

### Changed

- Do not automatically merge conflicts.
- Consolidate pull and push and their outputs.

## [3.0.11] - 2023-10-06

### Fixed
Expand Down Expand Up @@ -108,7 +119,7 @@ _Stable release based on [3.0.0-rc.2]._
## [2.2.0] - 2017-06-05
### Changed
- Increment minor version when release is created #31

### Fixed
- Initialization checks only local branches #73
- `omgf pull` updates only local branches with remote branch #59
Expand Down Expand Up @@ -165,6 +176,8 @@ _Stable release based on [3.0.0-rc.2]._

## [1.0.0] - 2016-12-22

[3.1.0]: https://https://github.com/internetguru/flow/compare/v3.0.11...v3.1.0
[3.1.0-rc.1]: https://github.com/internetguru/flow/releases/tag/v3.0.11
[3.0.11]: https://https://github.com/internetguru/flow/compare/v3.0.10...v3.0.11
[3.0.10]: https://https://github.com/internetguru/flow/compare/v3.0.9...3.0.10
[3.0.9]: https://https://github.com/internetguru/flow/compare/v3.0.8...v3.0.9
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.11
3.1.0
30 changes: 15 additions & 15 deletions flow
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ main() {
|| err "${out}"
}

git_reset() {
local out
out="$(git reset "${@}" 2>&1)"
}

git_log() {
local out
out="$(git log "${@}" 2>&1)" \
Expand Down Expand Up @@ -243,7 +248,7 @@ main() {
git_merge() {
local out
out="$(env GIT_EDITOR=: git merge "${@}" 2>&1)" \
|| err "${out}"
|| err "${out}" 7
}

git_show() {
Expand Down Expand Up @@ -314,7 +319,7 @@ main() {
[[ ${CONFORM} == 0 ]] \
&& err "Local branch '${1}' is behind remote." 3
confirm "Merge branch '${1}' with its remote?"
update_branch "${1}"
git fetch --update-head-ok "${ORIGIN}" "${1}:${1}"
}

create_branch() {
Expand Down Expand Up @@ -387,10 +392,10 @@ main() {
&& return
git_merge_nocommit "${1}"
# hard reset version file regardless of a conflict
git reset -q "${VERSION}"
git_reset -q "${VERSION}"
git_checkout "${VERSION}"
flow_sed -i '/^<<<<<<< /d;0,/^=======$/s///;/^=======$/d;/^>>>>>>> /d' "${CHANGELOG}"
git_add .
git_add "${CHANGELOG}" "${VERSION}"
git_merge --continue
}

Expand Down Expand Up @@ -1106,19 +1111,14 @@ main() {
git_checkout "${BCHD}"
}

update_branch() {
git_fetch "${ORIGIN}" "${1}:${1}"
}

flow_pull() {
validate_git_remote
confirm '* Pull all remote branches?'
msg_start 'Pulling branches'
local gcb
gcb=$(current_branch)
git_fetch --all
git_fetch --tags
git_fetch "${ORIGIN}" --prune
git fetch --update-head-ok --all --prune
git fetch --tags
for branch in $(git_branch_format -r | grep "^${ORIGIN}" | flow_sed "s/^${ORIGIN}\///"); do
[[ "${branch}" == HEAD ]] \
&& continue
Expand All @@ -1135,17 +1135,17 @@ main() {
validate_git_remote
confirm '* Push all branches to the remote repository?'
msg_start 'Pushing all branches and tags'
git_push "${ORIGIN}" --all
git_push "${ORIGIN}" --tags
git push "${ORIGIN}" --all
git push "${ORIGIN}" --tags
msg_done
}

flow_request() {
validate_git_remote
local gcb
gcb=$(current_branch)
git_push "${ORIGIN}" "${1}"
git_push "${ORIGIN}" "${gcb}"
git push "${ORIGIN}" "${1}"
git push "${ORIGIN}" "${gcb}"
request_url_fromto "${gcb}" "${1}"
}

Expand Down
11 changes: 6 additions & 5 deletions flow.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ EXIT CODES
2
Parse or invalid option error.
3
Git is not conform with the branching model (fixable).
Nonconforming, fixable with --conform / --init.
4
Git is not conform with the branching model (unfixable).
Nonconforming, cannot be fixed automatically.
5
Git status is not empty AKA uncommitted changes.
Uncommitted changes.
6
Nothing to do (e. g. empty merge).

Nothing to do, e. g. empty merge.
7
Unexpected merge conflicts.

REPOSITORY
==========
Expand Down
21 changes: 21 additions & 0 deletions test/test.butt
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,24 @@ start "merge hotfix with unmerged staging"
debug "flow -n"
assert_equal "${status}" 0
end
#######################################
: $((i++))
start "merge staging into dev with conflicts"
take "${i}"
{
flow -iy \
&& flow --yes \
&& git checkout dev \
&& echo "dev content" > a \
&& git add a \
&& git commit -m "Update file 'a' in dev" \
&& git checkout staging \
&& echo "staging content" > a \
&& git add a \
&& git commit -m "Update file 'a' in staging" \
&& git checkout dev
} >/dev/null 2>&1
debug "flow --yes --conform"
assert_equal "${status}" 7
assert_equal "${errlines[0]}" "flow: error: Committing is not possible because you have unmerged files."
end

0 comments on commit 331be33

Please sign in to comment.