FHIR Chat · More merge problems · committers/git-help

Stream: committers/git-help

Topic: More merge problems


view this post on Zulip 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

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:29):

What happens in the cli?

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:29):

in my existing repo (my local clone, I think that's what the instructions mean)

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:30):

git fetch origin

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:30):

warning: redirecting to https://github.com/hl7/fhir/

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:30):

well, ok

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:31):

fatal: A branch named 'condition-definition' already exists

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:31):

In the cli instruction... After "git merge master" you need to then resolve the conflict

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip 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.)

view this post on Zulip 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

view this post on Zulip 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'

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:34):

And what does git status tell you?

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:34):

the instructions says git push origin master - surely that is wrong....

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:34):

no changes added to commit

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:34):

Can you paste the complete output of git Status?

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:35):


view this post on Zulip 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")

view this post on Zulip 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

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:36):

And does "git push" (i.e., to the condition-definition branch) have no effect?

view this post on Zulip 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

view this post on Zulip 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'.

view this post on Zulip 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?

view this post on Zulip 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

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:38):

Let me take a look locally

view this post on Zulip 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

view this post on Zulip 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" ?

view this post on Zulip 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.)

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:45):

well, why not? it'll just make the build take longer

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:45):

OK.

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:46):

Done.

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:46):

FYI here's the log of my session that tells the story

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip 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)

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:48):

I don't know why the spreadsheet changes, btw.

view this post on Zulip Josh Mandel (Jun 17 2019 at 03:48):

I'm not sure how to do better than this.

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:49):

well, we should at least can these instructions...

view this post on Zulip 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.

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:53):

the cache is built from an API.... it's mostly latency it's dealing with

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:53):

so not sure how an API would help

view this post on Zulip Grahame Grieve (Jun 17 2019 at 03:53):

the cache does get stale... I rebuild it occasionally.

view this post on Zulip Josh Mandel (Jun 17 2019 at 04:01):

Those instructions look good -- but would add a "git fetch origin" at the beginning

view this post on Zulip Grahame Grieve (Jun 17 2019 at 04:05):

http://wiki.hl7.org/index.php?title=GIT_conflict_resolution_documentation

view this post on Zulip Josh Mandel (Jun 17 2019 at 04:20):

I thought we had moved to Confluence :)

view this post on Zulip 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