Skip to content

Add developer's docs on Git workflows#1072

Merged
sarina merged 1 commit into
mainfrom
devguide/git-resources
May 14, 2025
Merged

Add developer's docs on Git workflows#1072
sarina merged 1 commit into
mainfrom
devguide/git-resources

Conversation

@sarina
Copy link
Copy Markdown
Contributor

@sarina sarina commented May 7, 2025

Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
@kdmccormick kdmccormick self-requested a review May 8, 2025 17:28
Copy link
Copy Markdown

@wgu-taylor-payne wgu-taylor-payne left a comment

Choose a reason for hiding this comment

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

This added documentation is great and will serve as a nice reference! I've added some comments of things that could be cleaned up or improved upon.

Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated

Making a pull request is very similar to the simple one-remote workflow:

#. Create a branch locally: ``git switch -c user/description``.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not familiar - should branch names be in this form when working on Open edX repos?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When pushing branches to the upstream, yes.

When pushing branches to personal/org forks, that's totally up to you/your org.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW, I personally default to using my own forks for everything, regardless of whether I have access to push to the upstream repo. The only time I push branches to the upstream repo are when CI permissions demand it, like what happens with edx-val and Pactflow (which is very rare).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have noticed many maintainers pushing to their maintained repositories so I still think this recommendation makes sense.

Copy link
Copy Markdown
Member

@kdmccormick kdmccormick May 13, 2025

Choose a reason for hiding this comment

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

I agree, the username prefixing never hurts, so I think it's good to leave this recommendation as-is. Developers can of course push whatever branch names they like to their personal forks, but we don't need to complicate this guidance by spelling that out.

Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
@sarina sarina force-pushed the devguide/git-resources branch from 244e342 to 1fe7a30 Compare May 8, 2025 20:27
Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
* Before submitting your PR for review, perform an `interactive rebase`_, and
squash away any commits which will not be useful to other developers.
* During your PR review, as you edit your code in response to feedback, name
your new commits using the `squash:` prefix. This will indicate to the
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would squash! and fixup! messages be more convenient for those doing the merge/rebase into main?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

! means breaking changes, so I don't think that's appropriate.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sarina

If you use the --squash or --fixup flags while committing, git will create a commit with a message that starts with squash! or fixup!. Any commits that start with those will automatically be squashed when you use the --autosquash flag during a rebase.

I actually just learned about these while reading OEP-51. It mentions these types of commits under the Discussion section and Tooling section.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good point Taylor, I agree that we should encourage the use of built-in git message formats like squash! and fixup!, even though they are similar to conventional commits' notation for breaking changes.

Small point of information: The syntax for these is squash! <message>, not squash!: message, so it is subtly different than a conventional commit breaking change message.

These commits should never show up in main or master (because they'll be squashed away) so I'm not too concerned about the confusion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will using squash! or fixup! on a WIP PR cause the commitlint to fail?

If not, would someone want to suggest some text to put here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I opened a suggestion thread over here: #1072 (comment)

Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
@sarina
Copy link
Copy Markdown
Contributor Author

sarina commented May 13, 2025

@kdmccormick @wgu-taylor-payne any other feedback?

Comment thread source/developers/references/developer_guide/process/using-git.rst Outdated
@sarina
Copy link
Copy Markdown
Contributor Author

sarina commented May 13, 2025

@kdmccormick committed you change, let's make sure it renders correctly then you can approve/merge.

One note is that it doesn't seem possible to make formatted text also a hyperlink in RST.

@sarina
Copy link
Copy Markdown
Contributor Author

sarina commented May 13, 2025

Copy link
Copy Markdown
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Whoops, my suggestion was markdown instead of rST, thanks for fixing that.

LGTM!

@sarina sarina force-pushed the devguide/git-resources branch from fb5e2a2 to dbafde9 Compare May 14, 2025 13:09
@sarina sarina enabled auto-merge (rebase) May 14, 2025 13:09
@sarina sarina merged commit 2f3165a into main May 14, 2025
2 checks passed
@sarina sarina deleted the devguide/git-resources branch May 14, 2025 13:27
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.

4 participants