Support fast-forward merges
When the destination of the merge has no changes (i.e. it no new commits since the feature branch was created) - allow to merge back by simply pointing the destination branch to the HEAD of the source branch - without creating a merge commit.
Decide which is the default behavior when the destination branch has no changes. The user should be able to trigger the non-default behavior using a flag. For example, Git has the --no-ff flag to force the creation of a merge commit.
#3274 is also possibly relevant.
This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.
Closing this issue because it has been stale for 7 days with no activity.
Adding a potential use case for fast forward merges -
We have a files for a qa set stored in lakefs, with a .lakefs_ref.yaml file in our git repo referencing a specific branch and commit. Since anyone's changes could affect all the files, we want the main branch in lakefs to be fast-forward merge only, i.e. any other operation is likely an indication of an error.
The other advantage of this is we can now in a background process merge lakefs feature branch commits (checked into git main), back into lakefs main asynchronously. Since only fast forward merges are allowed we can be sure the commit hash is always the same.
Edit - Slack thread with full context here https://lakefs.slack.com/archives/C016726JLJW/p1727144259326919