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

Add fully-qualified ref name to Branch #7473

Open
iAmWillShepherd opened this issue May 6, 2019 · 0 comments
Open

Add fully-qualified ref name to Branch #7473

iAmWillShepherd opened this issue May 6, 2019 · 0 comments
Labels
tech-debt Issues and pull requests related to addressing technical debt or improving the codebase

Comments

@iAmWillShepherd
Copy link
Contributor

A few months ago, we ran into an issue with the branch pruner failing because some of the named refs were ambiguous. The problem turned out to be a tag having the same name as a branch. This ambiguity was the root cause of the errors git was throwing.

The fix involved getting the canonical ref name in the mix so there would be no chance of name conflicts (#6863 (comment)).

Fast forward to today, we have another feature, stashing, that relies on named refs to work properly. Since the ref-name is stored in the custom Desktop stash message, it is very important that Desktop can find these branches unambiguously. At the moment, we are using the short ref name to associate branches with stash entries, but that introduces the same risks we observed in the branch pruner.

I'm propose we update the Branch model to include the fully-qualified ref name and use that field for named ref comparisons to rule out the possibility of errors caused by ambiguous refs.

FWIW, we are already getting this information, but we don't use it directly in the Branch model.

const format = [
'%(refname)',
'%(refname:short)',
'%(upstream:short)',
'%(objectname)', // SHA
'%(objectname:short)', // short SHA
'%(author)',
'%(committer)',
'%(parent)', // parent SHAs
'%(symref)',
'%(subject)',
'%(body)',
'%(trailers:unfold,only)',
`%${delimiter}`, // indicate end-of-line as %(body) may contain newlines
].join('%00')

@iAmWillShepherd iAmWillShepherd added tech-debt Issues and pull requests related to addressing technical debt or improving the codebase meta Issues used to co-ordinate tasks, or discuss a feature before the required work is captured labels May 6, 2019
@iAmWillShepherd iAmWillShepherd removed the meta Issues used to co-ordinate tasks, or discuss a feature before the required work is captured label Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Issues and pull requests related to addressing technical debt or improving the codebase
Projects
None yet
Development

No branches or pull requests

1 participant