Unable to check out trac tickets

48 views
Skip to first unread message

Zachary Gershkoff

unread,
Jul 24, 2017, 9:01:03 PM7/24/17
to sage-support
I tried to create a new ticket and link it to an existing local branch using git-trac. The trac ticket was created, but attaching a local branch to it failed. I tried checking out the ticket that it created (23536) and this happened:

zgersh2@helmholtz:~/sage$ git trac checkout 23536
Loading ticket #23536...
Newly created local branch: t/23536/transversal_matroids
Traceback (most recent call last):
  File "/U1/accounts/zgersh2/git-trac-command/bin/git-trac", line 18, in <module>
    cmdline.launch()
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/cmdline.py", line 215, in launch
    app.checkout(args.ticket_or_branch, args.branch_name)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/app.py", line 116, in checkout
    self._checkout_ticket(int(ticket_or_branch), branch_name)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/app.py", line 134, in _checkout_ticket
    self.repo.create(local)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/git_repository.py", line 145, in create
    self.git.fetch('trac', starting_branch)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/git_interface.py", line 341, in meth
    return self.execute(git_cmd, *args, **kwds)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/git_interface.py", line 328, in execute
    popen_stderr=subprocess.PIPE)
  File "/U1/accounts/zgersh2/git-trac-command/git_trac/git_interface.py", line 263, in _run
    raise GitError(result)
git_trac.git_error.GitError: git returned with non-zero exit code (1) when executing "git fetch trac develop"
    STDERR: error: garbage at end of loose object '20d0fd3d389aeea9ad4b9b91cfeeab9f03607478'
    STDERR: fatal: loose object 20d0fd3d389aeea9ad4b9b91cfeeab9f03607478 (stored in .git/objects/20/d0fd3d389aeea9ad4b9b91cfeeab9f03607478) is corrupt
    STDERR: error: git://trac.sagemath.org/sage.git did not send all necessary objects
    STDERR:

I'm not sure what to do here. Apparently I have to take out some garbage before uploading my changes?

For what it's worth, the branch "t/23536/transveral_matroids" was not actually created, since it doesn't show up when I use "git branch".

Dima Pasechnik

unread,
Jul 25, 2017, 1:15:54 AM7/25/17
to sage-support
So you want to push the current branch to trac; you have committed local changes.
Show us the output of

git status

if unsure. Then, in case,
check that track's repo is known as trac. Type

git remote -v

In the output you should see the line

trac g...@trac.sagemath.org:sage.git (push)

Then do

git push trac --set-upstream HEAD:u/zgershkoff/transversal_matroids

It should succeed, assuming your authentication with trac git is set up OK,
and setting the local branch to follow the remote one (anyway, the latter is no big deal if you only work on this branch from one local repo).

Finally, edit the ticket on trac and put
u/zgershkoff/transversal_matroids into the branch field.
Done.

Dima Pasechnik

unread,
Jul 25, 2017, 1:24:52 AM7/25/17
to sage-support
PS. This does not use git-trac, just plain git.
If you succeeded doing the above, you'd be able to call yourself a git guru. :-)

Zachary Gershkoff

unread,
Jul 25, 2017, 6:02:24 PM7/25/17
to sage-support
That worked! I did have uncommitted changes because there was a file I didn't want to commit, but I removed it from the directory. Creating the remote branch the way you said and then setting the branch on the trac ticket manually seemed to work.

Zachary Gershkoff

unread,
Aug 2, 2017, 9:09:10 PM8/2/17
to sage-support
This error with "garbage at end of loose object" is coming back to plague me. I recently tried to upgrade sage by pulling the develop branch, but I couldn't.

zgersh2@helmholtz:~/sage$ git checkout develop
Switched to branch 'develop'
zgersh2@helmholtz:~/sage$ git pull
remote: Counting objects: 3375, done.
remote: Compressing objects: 100% (682/682), done.
remote: Total 3375 (delta 2860), reused 3192 (delta 2678), pack-reused 0
Receiving objects: 100% (3375/3375), 790.77 KiB | 247 KiB/s, done.

error: garbage at end of loose object '20d0fd3d389aeea9ad4b9b91cfeeab9f03607478'
fatal: loose object 20d0fd3d389aeea9ad4b9b91cfeeab9f03607478 (stored in .git/objects/20/d0fd3d389aeea9ad4b9b91cfeeab9f03607478) is corrupt
fatal: index-pack failed

What can I do, short of deleting everything and cloning the entire repository again?

Zachary Gershkoff

unread,
Aug 2, 2017, 10:29:29 PM8/2/17
to sage-support
I followed the instructions on https://stackoverflow.com/a/18238322 and it seems to be working so far. I lost all my local branches, but I don't mind.


On Monday, July 24, 2017 at 8:01:03 PM UTC-5, Zachary Gershkoff wrote:
Reply all
Reply to author
Forward
0 new messages