Gazler / githug

Git your game on!
MIT License
6.86k stars 1.03k forks source link

Level 45 - Solution does not seem to work #258

Closed florianluediger closed 4 years ago

florianluediger commented 5 years ago

As far as I can see, I have correctly solved level 45, however it does not pass the test from githug.

Steps to reproduce:

  1. githug reset 45
  2. git rebase --interactive HEAD^^
  3. remove second "o" from the upper commit message, using the "reword" command
  4. githug play
  5. It says: "Sorry, this solution is not quite right!"

The output from git log looks like the following:

commit 3ef8e2ff4a65c8ce4492249dfe1ddd4dca34b618 (HEAD -> master)
Author: Florian Lüdiger <xxx@xxx>
Date:   Thu May 2 21:18:42 2019 +0200

    Second commit

commit 279921357b0966bf049a6c38284900bb2db533f6
Author: Florian Lüdiger <xxx@xxx>
Date:   Thu May 2 21:18:42 2019 +0200

    First commit

commit df3de1fc3d6254e3806169a829505513fe7856c6
Author: Florian Lüdiger <xxx@xxx>
Date:   Thu May 2 21:18:42 2019 +0200

    Initial commit

I have checked the problem definition and the solution only requires the commit message to be "First commit", which it is in my case.

I have not had problems with any of the previous levels.

HanderWei commented 5 years ago

I got the same problem.

xingdongzhe commented 5 years ago

I got the same problem,too

xingdongzhe commented 5 years ago

I have solve this! You need to change both Second commit and First coommit to First commit! But i don't know why

Gazler commented 5 years ago

This worked for me:

$ githug reset 45
********************************************************************************
*                                    Githug                                    *
********************************************************************************
resetting level

Name: rename_commit
Level: 45
Difficulty: ***

Correct the typo in the message of your first (non-root) commit.

$ git log
5fcf296 Second commit (6 seconds ago, Gary Rennie)
a67572b First coommit (6 seconds ago, Gary Rennie)
762dc5f Initial commit (6 seconds ago, Gary Rennie)

$ git rebase -i HEAD~2
[detached HEAD 0954f5d] First commit
 Date: Thu May 16 08:31:01 2019 +0100
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file1
Successfully rebased and updated refs/heads/master.

$ git log
65af35d Second commit (2 seconds ago, Gary Rennie)
0954f5d First commit (6 seconds ago, Gary Rennie)
762dc5f Initial commit (21 seconds ago, Gary Rennie)

$ githug
********************************************************************************
*                                    Githug                                    *
********************************************************************************
Congratulations, you have solved the level!

What git version? I'm using 2.14.1

florianluediger commented 5 years ago

Interesting, today I tried it again with a fresh folder for githug and now it seems to work fine. It seems like I am not able to reproduce the issue anymore.

I am using the following git version btw: 2.16.2.windows.1

dthemg commented 5 years ago

I have this issue too, and with @XingDongZhe 's solution it works. git version 2.17.1 and using WSL git rebase -i HEAD~2 Then rewording only the second commit does not give a correct solution.

Sumsky21 commented 4 years ago

@XingDongZhe Your solution is great. I pass this level by changing both commit message to 'First commit'. I'm using WSL(Ubuntu) too. Git version 2.17.1. Seem like a bug?

gchazot commented 4 years ago

Renaming just the second commit (i.e. NOT the first one) works for me.

EDIT: This pointed me to the issue which to me is a bug in the test. PR #276 offers a fix