rtyley / agit

Agit - Git client for Android
https://play.google.com/store/apps/details?id=com.madgag.agit
GNU General Public License v3.0
503 stars 108 forks source link

Agit fetch apparently completes, but new commits are not displayed #92

Closed maisonobe closed 11 years ago

maisonobe commented 11 years ago

Since a few weeks, I am completely unable to use Agit. It clones public repositories properly the first time, but it never sees new commits. When I force it to fetch with the spin arrows at the right of the top red bar, it notifies me about fetch, then say fetch is complete, but the last commit is always the one the was created at clone time. New commits never appear.

I have tried on several git repositories with several protocols. An example using git protocol is git://git.apache.org/commons-math.git, and an example with http protocol is http://www.orekit.org/git/orekit.

I looked at the /sdcard/git-repos/the-repo-name.git/FETCH_HEAD, and the sha1 seemed correct and seemed to point to the latest commit, as if it was correctly retrieved from the remote server. However, looking into the objects directory, I found only an empty info and a pack directory with a few pack file, but all of them were older than the more recent commit. I did not find the bunch of classical directories 00, 01 ... ff that hold objects as in my desktop computer (I use a Debian Linux computer).

sakekasi commented 11 years ago

It works if you uncheck the bare option when cloning.

rtyley commented 11 years ago

I've just verified this issue when using a bare clone of https://github.com/rtyley/jgit - damn, thanks @maisonobe for reporting this, it's a pretty awful regression.

There doesn't seem to be any obvious reason why this regression would have occurred in the last release, apart from 470d0a7e, which was an update to the latest version of JGit at the time, v2.2.0.

I'll look into it - thanks for reporting the issue.

rtyley commented 11 years ago

I've released Agit v1.37 to the Google Play Store, it should start showing up there within a few hours. This is an interim release, just to get things working again. It reverts back to using JGit 2.0, as JGit 2.1 introduced some unknown change that cause the problem - I'm still investigating what exactly that is, and will likely make another release with the latest version of JGit (v2.3.1) once I work out what's going on.

Integration tests for this issue have been added with 6fd4b1c to ensure there's no further chance for regression here.

maisonobe commented 11 years ago

I confirm he issue is fixed with the latest version from the Google Play Store.

Thanks a lot for this really quick fix!

rtyley commented 11 years ago

The full fix for this issue (commit 06ef150) is in release v1.38, just released to the Google Play Store. The fix is a patched version of JGit that includes these two patches:

https://git.eclipse.org/r/10810 - don't generate malformed fetch refspecs https://git.eclipse.org/r/11027 - tolerate malformed refspecs (to cope with repos already cloned with an old version)

Thanks again for the bug report!