mergemodes #131

Manually merged
adamm merged 3 commits from mergemodes into main 2026-03-03 17:29:59 +01:00
Owner
No description provided.
adamm added 2 commits 2026-02-20 02:08:11 +01:00
pr: add function that checks and prepares PRs
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 26s
db70452cbc
Author
Owner
Merge Mode Description
ff-only Only allow --ff-only merges in the package branch. This is best suited for
devel projects and openSUSE Tumbleweed development, where history should be linear
replace Merge is done via -X theirs strategy and old files are removed in the merge.
This works well for downstream codestreams, like Leap, that would update their branch
using latest version.
devel No merge, just set the project branch to PR HEAD. This is suitable for downstream
projects like Leap during development cycle, where keeping maintenance history is not important
| Merge Mode | Description |------------|-------------------------------------------------------------------------------- | ff-only | Only allow --ff-only merges in the package branch. This is best suited for | | devel projects and openSUSE Tumbleweed development, where history should be linear | replace | Merge is done via `-X theirs` strategy and old files are removed in the merge. | | This works well for downstream codestreams, like Leap, that would update their branch | | using latest version. | devel | No merge, just set the project branch to PR HEAD. This is suitable for downstream | | projects like Leap during development cycle, where keeping maintenance history is not important
Author
Owner

I've tested that "replace" mode adds a merge commit to the source repo.

testing/xz#3

Consequence is it makes the unrelated histories have a diff again.

"devel" mode is untested

I've tested that "replace" mode adds a merge commit to the source repo. https://src.opensuse.org/testing/xz/pulls/3 Consequence is it makes the unrelated histories have a diff again. "devel" mode is untested
adamm requested review from atartamo 2026-02-20 02:16:26 +01:00
adamm requested review from jzerebecki 2026-02-22 23:20:27 +01:00
adamm added 1 commit 2026-02-24 17:51:32 +01:00
pr: No need to try to merge changes
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 28s
e1059e9447
We can reset current worktree and clobber it with the merged changes.
We want to emulate `git merge -s theirs` strategy while
`git merge -Xtheirs` only picks `theirs` in case of conflicts.
So, resetting the changes and reading exact is sufficient

`git read-tree -u` updates the current work tree so we do not have
unstaged changes.
First-time contributor

Looks good! Thank you @adamm I think we have only very tiny portion of packages wheere we would not update directly from Tumbleweed. So generally ff-only would be okay for 99%

Looks good! Thank you @adamm I think we have only very tiny portion of packages wheere we would not update directly from Tumbleweed. So generally ff-only would be okay for 99%
First-time contributor

As discussed in https://github.com/openSUSE/osc/pull/2050 merging using -X theirs creates merge artifacts. It only updates files that have conflicts. Non-conflicting files can diverge.

As discussed in https://github.com/openSUSE/osc/pull/2050 merging using `-X theirs` creates merge artifacts. It only updates files that have conflicts. Non-conflicting files can diverge.
adamm force-pushed mergemodes from e1059e9447 to 95632d3d7d 2026-02-27 12:38:26 +01:00 Compare
Author
Owner

As discussed in https://github.com/openSUSE/osc/pull/2050 merging using -X theirs creates merge artifacts. It only updates files that have conflicts. Non-conflicting files can diverge.

I know, it's not what it's doing. It's reading the tree from the other. The "merge" is just to avoid conflicts, and the actual listing is from the other commit. No duplicates stuff.

if err := git.GitExec(repo.Name, "merge", "--no-ff", "--no-commit", "-X", "theirs", head.Sha); err != nil {
		if err := git.GitExec(repo.Name, "merge", "--no-ff", "--no-commit", "--allow-unrelated-histories", "-X", "theirs", head.Sha); err != nil {
			return false
		}
		LogError("WARNING: Merging unrelated histories")
	}

	// ensure only files that are in head.Sha are kept
	git.GitExecOrPanic(repo.Name, "read-tree", "--reset", "-u", head.Sha)
	
	git.GitExecOrPanic(repo.Name, "commit", "-m", msg)
> As discussed in https://github.com/openSUSE/osc/pull/2050 merging using `-X theirs` creates merge artifacts. It only updates files that have conflicts. Non-conflicting files can diverge. I know, it's not what it's doing. It's reading the tree from the other. The "merge" is just to avoid conflicts, and the actual listing is from the other commit. No duplicates stuff. ```go if err := git.GitExec(repo.Name, "merge", "--no-ff", "--no-commit", "-X", "theirs", head.Sha); err != nil { if err := git.GitExec(repo.Name, "merge", "--no-ff", "--no-commit", "--allow-unrelated-histories", "-X", "theirs", head.Sha); err != nil { return false } LogError("WARNING: Merging unrelated histories") } // ensure only files that are in head.Sha are kept git.GitExecOrPanic(repo.Name, "read-tree", "--reset", "-u", head.Sha) git.GitExecOrPanic(repo.Name, "commit", "-m", msg) ```
Author
Owner

rebaesd ontop of current main - resolved conflicts with the new package handling

rebaesd ontop of current main - resolved conflicts with the new package handling
First-time contributor

After the recent factory history alteration, we would not be able to move forward easily without this so this definitely helps.

After the recent factory history alteration, we would not be able to move forward easily without this so this definitely helps.
adamm manually merged commit e5e1b5d9a5 into main 2026-03-03 17:29:59 +01:00
adamm removed review request for atartamo 2026-03-03 17:30:05 +01:00
adamm removed review request for jzerebecki 2026-03-03 17:30:07 +01:00
Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: git-workflow/autogits#131