Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no procedure for recording or recovering branch origins #273

Open
rptb1 opened this issue Nov 9, 2023 · 2 comments
Open

There is no procedure for recording or recovering branch origins #273

rptb1 opened this issue Nov 9, 2023 · 2 comments
Labels
needs analaysis The issue needs analysis before it can be resolved. optional Will cause failures / of benefit. Worth assigning resources. process To do with process or procedure

Comments

@rptb1
Copy link
Member

rptb1 commented Nov 9, 2023

As noted at https://stackoverflow.com/q/4477765 , Git does not permanently record where a branch begins, and so it is hard to record exactly what changes were made for a purpose or topic. This is something we have relied on in Perforce, and information we would like to avoid losing when migrating to Git #98 .

We need to think of a way that we can record this information, or a way that it can reliably be retrieved from Git. If necessary, we might need to export the information from Perforce as well.

This issue is mentioned in proc.review.entry.change, where it required to record the complete change for a topic

mps/procedure/review.rst

Lines 300 to 302 in 654c24c

- Otherwise, record something like the branch name and commit hash.
[Note: Git fails at this because merged branches forget their branch
points. We need some way to fix that. RB 2023-01-23]

@rptb1 rptb1 added the process To do with process or procedure label Nov 9, 2023
@rptb1 rptb1 changed the title Devise a procedure for recording or recovering branch origins There is no procedure for recording or recovering branch origins Nov 9, 2023
@thejayps
Copy link
Contributor

Comment from @rptb1 : the world seems to get along without this capability - how? Are our assumptions incorrect?

@thejayps thejayps added needs analaysis The issue needs analysis before it can be resolved. optional Will cause failures / of benefit. Worth assigning resources. labels Nov 13, 2023
@gareth-rees
Copy link
Member

gareth-rees commented Jan 6, 2024

The underlying requirement here seems to be able to find the purpose of a change, that is, what feature it was intended to implement, or what defect it was intended to fix. In a configuration management system where each change is associated with a branch, you can find the purpose of a change by looking up its branch and then finding the purpose of the branch (somehow; but note that this depends on following some discipline so that each branch has a single purpose).

In Git this approach is not practical because the association between changes (commits) and branches (refs) is transient, so what people do instead is to record the purpose of each commit in the commit message, for example, by referring to an issue according to some convention. For example, in the cpython repo each commit message starts "gh-N" where N is the number of the GitHub issue with which the commit is associated.

If you use GitHub pull requests you can look at a commit and GitHub will tell you which pull request it originated in (if any). This is less satisfactory because GitHub pull requests are not represented in the Git repository, so you risk losing the information if you switch away from GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs analaysis The issue needs analysis before it can be resolved. optional Will cause failures / of benefit. Worth assigning resources. process To do with process or procedure
Projects
None yet
Development

No branches or pull requests

3 participants