Problem/Motivation

The 7.x-1.x branch of farmOS has 4071 commits (as of this writing), with a rich history of changes, decisions, author credit, etc. This information is summarized in places like the GitHub project page: https://github.com/farmOS/farmOS

Notably, GitHub only summarizes information contained in the "default" branch of the repository. The 2.x branch was started as an orphan branch (it does not share a parent commit with any of 7.x-1.x's history). So when 2.x becomes the new default branch, it will appear as if farmOS has less history than it actually does.

Also, there are a number of files in 7.x-1.x that will not need to change (or will only change slightly) in 2.x. We could copy those files to 2.x right now, but that would require maintaining changes between the two branches during development, which is unnecessary effort.

Proposed resolution

When we are ready to make 2.x the default branch, I propose that we take a final step by merging 7.x-1.x into 2.x using the ours Git merge strategy, which will create a merge commit without making any changes. This will effectively indicate that 7.x-1.x has been incorporated into the default branch, thus keeping its history as part of the official default branch.

As for the files that we do want to preserve from 7.x-1.x, it would be nice to have these be part of the same merge commit. One way to achieve this with Git is to first create the simple ours merge commit (which won't change anything in 2.x), then create/copy the files we want from 7.x-1.x and amend the merge commit.

Remaining tasks

  • Make a list of files that should be kept from 7.x-1.x.
  • Create a bash script to perform the merge.
  • Run the script before making 2.x the default branch.

Files to merge from 7.x-1.x

The following files can be merged verbatim from 7.x-1.x:

  • .github/FUNDING.yml
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/config.yml
  • CONTRIBUTING.md
  • COPYRIGHT.txt
  • LICENSE.txt
  • README.md

Bash script

Here is a script we can use to perform this merge.

#!/bin/bash

# Perform final merge of 7.x-1.x into the current branch using the "ours"
# strategy to discard all changes from 7.x-1.x. This serves to indicate
# that 7.x-1.x has been incorporated into the new main line, thus preserving
# its full history, commit counts, contributor/author info, etc.
git merge -s ours --allow-unrelated-histories origin/7.x-1.x

# Selectively copy files from 7.x-1.x that we want to keep and amend the merge.
git checkout origin/7.x-1.x .github/FUNDING.yml
git checkout origin/7.x-1.x .github/ISSUE_TEMPLATE/bug_report.md
git checkout origin/7.x-1.x .github/ISSUE_TEMPLATE/config.yml
git checkout origin/7.x-1.x CONTRIBUTING.md
git checkout origin/7.x-1.x COPYRIGHT.txt
git checkout origin/7.x-1.x LICENSE.txt
git checkout origin/7.x-1.x README.md
git commit --amend

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

m.stenta’s picture

Issue summary: View changes

Added an initial list of files that can be copied verbatim from 7.x-1.x. It's a very small list, and most of them rarely change, so it may actually be safe to merge some sooner. The REAMDE.md is the only one that might need more upkeep (if new sponsors are added, etc). So maybe we do the rest and just wait on that one.

m.stenta’s picture

Issue summary: View changes

Looking at README.md, it doesn't look like there's anything in there that would require changes either, so I merged the lists.

m.stenta’s picture

Issue summary: View changes

Started sketching the bash script. Pretty simple as well.

m.stenta’s picture

Status: Active » Postponed
Related issues: +#3162807: Make 2.x the default branch

Here is the issue for making 2.x the default branch: #3162807: Make 2.x the default branch

Postponing this until everything in #3092830: [META] farmOS 2.x Roadmap is done.

m.stenta’s picture

Issue summary: View changes

We have a pull request open to add CONTRIBUTING.md and GitHub issue template files to the farmOS repository: https://github.com/farmOS/farmOS/pull/376/files

Updating the description above, under that assumption that the pull request will be merged.

m.stenta’s picture

Issue summary: View changes

Added .github/ISSUE_TEMPLATE/config.yml to the issue description/script.

m.stenta’s picture

Issue tags: +stable blocker
m.stenta’s picture

Issue tags: +beta blocker

I wonder: should we consider doing this for the beta release? And not wait for 2.0.0 "stable"?

m.stenta’s picture

Issue summary: View changes

m.stenta’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.