Stream: committers/git-help
Topic: More merge problems
Grahame Grieve (Jun 17 2019 at 03:28):
https://github.com/HL7/fhir/pull/591 - merge conflict. So:
- "resolve conflicts" doesn't work - just hangs.
- "open in the github desktop" - I have no idea what that means but the link leads to nothing
- use the command line... the instructions are just wrong
Josh Mandel (Jun 17 2019 at 03:29):
What happens in the cli?
Grahame Grieve (Jun 17 2019 at 03:29):
I mean, they look wrong, and following them (a) doesn't work in my existing repository and (b) works but does nothing in a brand new one
Grahame Grieve (Jun 17 2019 at 03:29):
in my existing repo (my local clone, I think that's what the instructions mean)
Grahame Grieve (Jun 17 2019 at 03:30):
git fetch origin
Grahame Grieve (Jun 17 2019 at 03:30):
warning: redirecting to https://github.com/hl7/fhir/
Grahame Grieve (Jun 17 2019 at 03:30):
well, ok
Grahame Grieve (Jun 17 2019 at 03:31):
fatal: A branch named 'condition-definition' already exists
Josh Mandel (Jun 17 2019 at 03:31):
In the cli instruction... After "git merge master" you need to then resolve the conflict
Grahame Grieve (Jun 17 2019 at 03:31):
oops:
git checkout -b condition-definition origin/condition-definition
fatal: A branch named 'condition-definition' already exists
Josh Mandel (Jun 17 2019 at 03:32):
So I'd 1) check out the relevant Branch from your local repo, 2) git merge master, 3) fix the merge conflict, 4) git push the branch up to GitHub
Grahame Grieve (Jun 17 2019 at 03:32):
what exactly does 'resolve the the conflict' mean? Because I thought it meant actually opening the file and editing the conflicts.... which lead to an error message saying that merge couldn't merge because i had unmerged files.... that's a real winner, that error message
Josh Mandel (Jun 17 2019 at 03:32):
(In general: the approach to committing cache files continues to cause pain. It'd be good to brainstorm about alternatives.)
Josh Mandel (Jun 17 2019 at 03:33):
It's means opening the file, editing, saving the file and then doing "git add file" --- "git status" should give you hints about what you need to do
Grahame Grieve (Jun 17 2019 at 03:33):
so check out the branch... I mean, I'm already in the branch.... so then I git merge master and it says 'already up to date'
Josh Mandel (Jun 17 2019 at 03:34):
And what does git status tell you?
Grahame Grieve (Jun 17 2019 at 03:34):
the instructions says git push origin master - surely that is wrong....
Grahame Grieve (Jun 17 2019 at 03:34):
no changes added to commit
Josh Mandel (Jun 17 2019 at 03:34):
Can you paste the complete output of git Status?
Grahame Grieve (Jun 17 2019 at 03:35):
Grahame Grieve (Jun 17 2019 at 03:35):
On branch condition-definition Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) deleted: tools/java/org.hl7.fhir.tools.core/bin/.gitignore no changes added to commit (use "git add" and/or "git commit -a")
Grahame Grieve (Jun 17 2019 at 03:36):
I'm not interested in that .gitignore file right now. I don't know why it comes and goes, just another git mystery, but it's not my problem
Josh Mandel (Jun 17 2019 at 03:36):
And does "git push" (i.e., to the condition-definition branch) have no effect?
Grahame Grieve (Jun 17 2019 at 03:36):
fatal: The current branch condition-definition has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin condition-definition
Grahame Grieve (Jun 17 2019 at 03:37):
C:\work\org.hl7.fhir\build>git push --set-upstream origin condition-definition warning: redirecting to https://github.com/hl7/fhir/ Everything up-to-date Branch 'condition-definition' set up to track remote branch 'condition-definition' from 'origin'.
Josh Mandel (Jun 17 2019 at 03:37):
Well, you could do that, but I'm not clear on what it's not already linked -- is this not the checkout you've been working from?
Grahame Grieve (Jun 17 2019 at 03:38):
it was. On the condition-definition branch. But then i tried to follow the github instructions and I have no idea what state it's in now
Josh Mandel (Jun 17 2019 at 03:38):
Let me take a look locally
Grahame Grieve (Jun 17 2019 at 03:43):
as far as the cache files... I haven't got any better idea. it takes 90-120 minutes to build them from scratch. so I don't think we want everyone to have to deal with that much longer added to the build
Josh Mandel (Jun 17 2019 at 03:44):
So I can't reproduce the issues you're seeing -- is it possible you haven't run "git fetch" before doing "git merge origin/master" ?
Josh Mandel (Jun 17 2019 at 03:45):
(I'd also be happy to just push a commit for you that overwrites vscache/null.cache
in your branch with the version from master, which will fix the merge problem, but I'm not sure if that's the version of the file you want.)
Grahame Grieve (Jun 17 2019 at 03:45):
well, why not? it'll just make the build take longer
Josh Mandel (Jun 17 2019 at 03:45):
OK.
Josh Mandel (Jun 17 2019 at 03:46):
Done.
Josh Mandel (Jun 17 2019 at 03:46):
FYI here's the log of my session that tells the story
Grahame Grieve (Jun 17 2019 at 03:46):
but given that the git cli instructions are all wrong, and the web editor fails for anything but the most simple cases... maybe we should get some correct instructions.... though why github gets it wrong.... I don't know
Josh Mandel (Jun 17 2019 at 03:47):
jmandel@trumpet:~/work/fhir$ git fetch jmandel@trumpet:~/work/fhir$ git checkout condition-definition Branch 'condition-definition' set up to track remote branch 'condition-definition' from 'origin'. Switched to a new branch 'condition-definition' jmandel@trumpet:~/work/fhir$ git merge origin/master Auto-merging vscache/null.cache CONFLICT (content): Merge conflict in vscache/null.cache Automatic merge failed; fix conflicts and then commit the result. jmandel@trumpet:~/work/fhir$ git status On branch condition-definition Your branch is up to date with 'remotes/origin/condition-definition'. You have unmerged paths. (fix conflicts and run "git commit") (use "git merge --abort" to abort the merge) Changes to be committed: modified: source/careplan/careplan-spreadsheet.xml modified: source/condition/condition-spreadsheet.xml modified: source/familymemberhistory/familymemberhistory-genetics-profile-spreadsheet.xml modified: source/observationdefinition/observationdefinition-example.xml modified: source/observationdefinition/observationdefinition-spreadsheet.xml modified: source/procedure/procedure-spreadsheet.xml modified: source/specimendefinition/specimendefinition-example-serum-plasma.xml modified: source/specimendefinition/specimendefinition-spreadsheet.xml modified: source/status-codes.xml modified: tools/java/org.hl7.fhir.tools.core/.classpath Unmerged paths: (use "git add <file>..." to mark resolution) both modified: vscache/null.cache jmandel@trumpet:~/work/fhir$ git checkout --theirs vscache/null.cache jmandel@trumpet:~/work/fhir$ git status On branch condition-definition Your branch is up to date with 'remotes/origin/condition-definition'. You have unmerged paths. (fix conflicts and run "git commit") (use "git merge --abort" to abort the merge) Changes to be committed: modified: source/careplan/careplan-spreadsheet.xml modified: source/condition/condition-spreadsheet.xml modified: source/familymemberhistory/familymemberhistory-genetics-profile-spreadsheet.xml modified: source/observationdefinition/observationdefinition-example.xml modified: source/observationdefinition/observationdefinition-spreadsheet.xml modified: source/procedure/procedure-spreadsheet.xml modified: source/specimendefinition/specimendefinition-example-serum-plasma.xml modified: source/specimendefinition/specimendefinition-spreadsheet.xml modified: source/status-codes.xml modified: tools/java/org.hl7.fhir.tools.core/.classpath Unmerged paths: (use "git add <file>..." to mark resolution) both modified: vscache/null.cache jmandel@trumpet:~/work/fhir$ git add vscache/null.cache jmandel@trumpet:~/work/fhir$ git status On branch condition-definition Your branch is up to date with 'remotes/origin/condition-definition'. All conflicts fixed but you are still merging. (use "git commit" to conclude merge) Changes to be committed: modified: source/careplan/careplan-spreadsheet.xml modified: source/condition/condition-spreadsheet.xml modified: source/familymemberhistory/familymemberhistory-genetics-profile-spreadsheet.xml modified: source/observationdefinition/observationdefinition-example.xml modified: source/observationdefinition/observationdefinition-spreadsheet.xml modified: source/procedure/procedure-spreadsheet.xml modified: source/specimendefinition/specimendefinition-example-serum-plasma.xml modified: source/specimendefinition/specimendefinition-spreadsheet.xml modified: source/status-codes.xml modified: tools/java/org.hl7.fhir.tools.core/.classpath modified: vscache/null.cache jmandel@trumpet:~/work/fhir$ git commit -m "Fix vscache/null.cache conflict" [condition-definition 97803ffa5d] Fix vscache/null.cache conflict jmandel@trumpet:~/work/fhir$ git push
Josh Mandel (Jun 17 2019 at 03:48):
"Get some correct instructions" kind of depends on the situation you're in. Generally the git cli will give you good information about what steps to take, i.e. from my log above:
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Grahame Grieve (Jun 17 2019 at 03:48):
I don't know why the spreadsheet changes, btw.
Josh Mandel (Jun 17 2019 at 03:48):
I'm not sure how to do better than this.
Grahame Grieve (Jun 17 2019 at 03:49):
well, we should at least can these instructions...
Josh Mandel (Jun 17 2019 at 03:50):
Yes, that'd be good. Wiki?
Re: cache, maybe we can talk about an API that lives outside of git. Would be good to understand whether the cache is purely monotonic (like, do entries ever change or disappear), or could be.
Anyway, I'm off to bed.
Grahame Grieve (Jun 17 2019 at 03:52):
is this a right summary:
1. set up git checkout [branch] git merge origin/master git status > You have unmerged paths. > (fix conflicts and run "git commit") > (use "git merge --abort" to abort the merge) > Unmerged paths: > (use "git add <file>..." to mark resolution) > > both modified: ... 2. fix the file, or grab that least from master > grabbing the file from master: git checkout --theirs [path] 3. committingit git add [path] git commit -m "Fix [path] conflict" git push
Grahame Grieve (Jun 17 2019 at 03:53):
the cache is built from an API.... it's mostly latency it's dealing with
Grahame Grieve (Jun 17 2019 at 03:53):
so not sure how an API would help
Grahame Grieve (Jun 17 2019 at 03:53):
the cache does get stale... I rebuild it occasionally.
Josh Mandel (Jun 17 2019 at 04:01):
Those instructions look good -- but would add a "git fetch origin" at the beginning
Grahame Grieve (Jun 17 2019 at 04:05):
http://wiki.hl7.org/index.php?title=GIT_conflict_resolution_documentation
Josh Mandel (Jun 17 2019 at 04:20):
I thought we had moved to Confluence :)
Grahame Grieve (Jun 17 2019 at 04:21):
not apparently for FHIR stuff. I don't have a place to put it for FMG, and I got pointed back to the old wiki. it's on FMG todo list
Last updated: Apr 12 2022 at 19:14 UTC