Bug Git scripts don't handle updating with local changes under some conditions (conflicts?)

Ryo_Sangnoir

Developer
Staff member
Sometimes, new changes fail to be applied if there are local changes. It looks like:

Code:
Updating project Loathing-Associates-Scripting-Society-ChIT
Pull
Starting
remote:    Enumerating objects
remote: Counting objects
Receiving objects
Resolving    deltas
Updating references
Resetting head to adapt to limit_mode    change
No changes

The head reset doesn't actually occur, but origin/master is updated correctly, and the repository correctly identifies it's X commits behind. Notably, it never errors at any point, which makes me think my interpretation of how the library works is incorrect.
 

xKiv

Active member
Part of it is probably that "pull" is kind of a shorthand for first doing "fetch" (which, among other things, is what updates origin/master, and possibly also references), and merge or rebase (mafia uses rebase), which is where the "resetting head" comes from (and (silently?) fails because there are local uncommitted changes, or unmergeable changes - although that *should* emit at least a warning)

What happens when you go to that script's directory and do a manual "git pull --rebase"?
(actually, first you should probably do "git status" which I suspect will among other things suggest "git rebase --abort" - just to get the repository to a known, cleanish, starting point, in which repeating the rebase is actually a legal operation)
 

Ryo_Sangnoir

Developer
Staff member
Yep, the fetch succeeds, the rebase fails:

Code:
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

I was expecting this to throw an error when I wrote the original code, but it looks like call() returns a PullRequestResult that tells whether it succeeded or not.

I didn't want to mimic what SVN did because it is complicated. I should be able to handle a majority of cases by committing the unstaged changes and pulling. In case of failure I guess we just want to abort.
 
Top