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

"Can not fast forward" in GitBook Editor 4.2.3 Mac #1117

Open
warpech opened this Issue Jan 28, 2016 · 16 comments

Comments

Projects
None yet
7 participants
@warpech

warpech commented Jan 28, 2016

Using GitBook Editor 4.2.3 Mac, I always have a problem when one of my teammates pushes a change to a book while I have unsynced changes. We are hosting the book on GitHub.

When I press sync button, I get the following message:

screen shot 2016-01-28 at 12 40 05a

A workaround for that is to go to the git folder and do a manual git pull, which makes a merge by recursive strategy.

@miyconst

This comment has been minimized.

miyconst commented Jan 28, 2016

👍 This is extremely annoying. Would be very good to get it fixed.

@nagim

This comment has been minimized.

nagim commented Jan 28, 2016

I think it's not an editor related issue, rather how git works. If someone has pushed to the same branch as you, git cannot push your changes.
As you said, the solution is to make a git pull before, which you can do from the editor as well (in the menu, Book > Pull).
In order to avoid this kind of errors, it's useful to make a new branch for draft changes and merge it to master when it's done.

@warpech

This comment has been minimized.

warpech commented Jan 28, 2016

Using Book > Pull from the menu also tries to do a fast-forward merge, even when it's not possible. If I didn't know how to do a plain git pull in the command line, I would not be able to proceed.

@warpech

This comment has been minimized.

warpech commented Jan 28, 2016

See the below screengrab where I try both the Sync button (from the toolbar) and Pull option (from the menu):

bug

@nagim

This comment has been minimized.

nagim commented Jan 28, 2016

Hmmm, that's indeed strange. I know if you merge branches in the editor, it does not fast-forward, even if it would be possible. I assumed that Pull works the same.
Have you tried the 5.0.0-beta editor? There were some upgrades regarding git operations.

Cheers,
Imre

@warpech

This comment has been minimized.

warpech commented Jan 29, 2016

Same problem in 5.0.0-beta.6:

bug

@warpech

This comment has been minimized.

warpech commented Jan 29, 2016

Actually 5.0.0-beta.6 makes it more painful. With GitBook Editor 4.2.3 it was enough to do a git pull in the console (see the workaround described above).

In 5.0.0-beta.6, git pull does not work because saved changes are not commited:

screen shot 2016-01-29 at 13 16 32

I need to do a git stash before git pull.

@nagim

This comment has been minimized.

nagim commented Jan 29, 2016

Yes, the new beta comes with the new option of separating the saving and committing. This way, you can commit multiple changes in a single commit. There is a separate Commit button next to the Save button in the editor.
You can of course switch back to commit with every save in the editor settings.
Surely, it won't change the Pull behavior. @SamyPesse, do you think it's possible to modifiy the current behavior of the editor's Pull operation?

@warpech

This comment has been minimized.

warpech commented Jan 29, 2016

Yes, the new beta comes with the new option of separating the saving and committing. This way, you can commit multiple changes in a single commit. There is a separate Commit button next to the Save button in the editor.

That's a very welcome to have, I didn't know about it!

But I think it doesn't work at the moment, because it was on in my case:

screen shot 2016-01-29 at 13 48 04

Yet, my saved changes were not commited - therefore I needed to stash them.

@warpech

This comment has been minimized.

warpech commented Jan 29, 2016

Point is, I have never had such problem in the online editor, so I guess it is only the desktop editor that always wants to use ff.

On a side note, I wonder, what is the merging strategy for the online editor in case of a conflict?

Thanks a lot for being so responsive!

@SamyPesse

This comment has been minimized.

Member

SamyPesse commented Jan 29, 2016

@warpech Are you sure README.md and webshop.md were not edited by another program ?

GitBook Editor is not writing file on the disk before committing them (stored in the local-storage of the web view). Basically GitBook Editor can't work with staging file from other programs.

We are working on fixing all of this, currently we just prompt an error when there are conflicts during merge, our goal for the next release is to have a nice UI to resolve these conflicts.

@nagim

This comment has been minimized.

nagim commented Jan 29, 2016

@SamyPesse Thanks a lot, just what I wanted to ask/note about merge conflict, but you were faster. 😄

@warpech

This comment has been minimized.

warpech commented Jan 29, 2016

@warpech Are you sure README.md and webshop.md were not edited by another program ?

Yes, I've recorded another screengrab to show this:

bug

git status (as shown on the screengrab) shows that after saving there is a change in the index that is not commited.

@KINGSABRI

This comment has been minimized.

KINGSABRI commented Jan 29, 2016

Same issues here "Gitbook desktop editor Version 5.0.0-beta.6"

@duckrun

This comment has been minimized.

duckrun commented Feb 24, 2016

good: change log
bad: for local editor no conflict merge support (just telling you error), for web editor, either override or give up the changes, just no means to merge the conflict at all, which as a result almost CANNOT be used in collaborative editing

@aleen42

This comment has been minimized.

aleen42 commented Mar 15, 2016

Hello, I have solved it by finding the local directory, and use command to pull and push. Maybe, it's work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment