lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Did I resolve this git issue correctly?


From: Greg Chicares
Subject: [lmi] Did I resolve this git issue correctly?
Date: Wed, 7 Dec 2016 10:23:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

Vadim--I didn't notice that you had pushed this changeset:
  http://lists.nongnu.org/archive/html/lmi-commits/2016-12/msg00008.html
so of course I hadn't pulled it before committing some changes of my own;
when I pushed them, I saw:

$git push
Enter passphrase for key REDACTED: 
To REDACTED [at-sign] git.sv.gnu.org:/srv/git/lmi.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'REDACTED [at-sign] 
git.sv.gnu.org:/srv/git/lmi.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I took that "hint" and did this:

$git pull
Enter passphrase for key REDACTED: 
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
>From git.sv.gnu.org:/srv/git/lmi
   802eb23..0778129  master     -> origin/master
Merge made by the 'recursive' strategy.
 Makefile.am  | 1 +
 configure.ac | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

I was somewhat alarmed when the world's most sophisticated editor, nano,
took over my screen, but I typed some vapid message and did ctrl-O ctrl-X.
Then I did this:

$git log
commit 8f40291f7965c04dd0b7dd90c82eed3fb788ccc8
Merge: fd65f39 0778129
Author: Gregory W. Chicares <REDACTED>
Date:   2016-12-07 09:10:43 +0000

    Merge branch 'master' of git.sv.gnu.org:/srv/git/lmi
    
    Resolve overlapping pushes.

$git push
Enter passphrase for key REDACTED: 
Counting objects: 18, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.82 KiB | 0 bytes/s, done.
Total 18 (delta 13), reused 0 (delta 0)
remote: Sending notification emails to: address@hidden
To REDACTED [at-sign] git.sv.gnu.org:/srv/git/lmi.git
   0778129..8f40291  master -> master

Now 'git log' shows your c1c9c1a and 0778129, so I don't seem to have
harmed those.

The first change I pushed looked like this when I committed it:

commit eb8fbb6274b85a211cce518731b70b01b6fe6861
Author: Gregory W. Chicares <REDACTED>
Date:   2016-12-05 17:28:10 +0000

    Revert "Allow empty comments in rate tables"

...and the last looked like this:

commit fd65f393ef0c64c3e116d784a3cf7e14a8bb847f
Author: Gregory W. Chicares <REDACTED>
Date:   2016-12-07 08:58:23 +0000

    Improve rate-table accuracy

...and I'm somewhat surprised that they appear identical in 'git log'
now after I pulled your changes and pushed mine. I had expected that
git would have yanked my changes out and stuffed them back in with
different sha1sums. But I guess instead it applied my changes and
then generated commit 8f4029 above to merge them? That seems to fit
with what the "NOTE ABOUT FAST-FORWARDS" in `git push --help` says:

| You can perform "git pull", resolve potential conflicts, and "git push"
| the result. A "git pull" will create a merge commit C between commits A
| and B.
|
|           B---C
|          /   /
|      ---X---A
|
| Updating A with the resulting merge commit will fast-forward and your
| push will be accepted.

And if I ask to see whatever patch the merge generated...

$/opt/lmi/src/lmi[141]$git log --patch -1
commit 8f40291f7965c04dd0b7dd90c82eed3fb788ccc8
Merge: fd65f39 0778129
Author: Gregory W. Chicares <REDACTED>
Date:   2016-12-07 09:10:43 +0000

    Merge branch 'master' of git.sv.gnu.org:/srv/git/lmi
    
    Resolve overlapping pushes.

...there is none, I suppose because there were no conflicts.

I don't see where this did any harm, but did I handle it in the best way?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]