Dev scripts and closed tickets

31 views
Skip to first unread message

Volker Braun

unread,
Mar 3, 2014, 9:04:59 AM3/3/14
to sage...@googlegroups.com
Miguel pointed out to me that the dev scripts break when they find only  the SHA1 hash in the "Branch:" field. So if I have closed a ticket then you can't get the code from the dev scripts. Note that there is a delay between closing the ticket and the corresponding beta release. Using git directly or the git-trac script works, for the record. It would be nice if somebody who actually uses the dev scripts would fix that.
 

mmarco@artin:~/sage/sage$ ./sage -dev checkout --ticket 15873
The branch field on ticket #15873 is set to the non-existent "1a91835f99e01395b74226e185ed88f6cf26031a". Please set the field on trac to a field value.                                                            
#  (use "sage --dev edit-ticket --ticket=15873" to edit the ticket description)      

Jeroen Demeyer

unread,
Aug 13, 2014, 9:35:45 AM8/13/14
to sage...@googlegroups.com
On 2014-03-03 15:04, Volker Braun wrote:
> Miguel pointed out to me that the dev scripts break when they find only
> the SHA1 hash in the "Branch:" field.
This is still the case:

jdemeyer@sage3:/opt/sage/sage-6.3$ ./sage --dev checkout --ticket 16800
The branch field on ticket #16800 is set to the non-existent
"e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994". Please set the field on trac
to a field value.

# (use "sage --dev edit-ticket --ticket=16800" to edit the ticket
description)


> Using git directly or the git-trac script works, for the record.
Unfortunately, it doesn't work for me. I'm probably missing some basic
configuration, but I don't know what I did wrong:

jdemeyer@sage3:/opt/sage/sage-6.3$ git trac checkout 16800
Loading ticket #16800...
Checking out Trac #16800 remote branch
e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994 -> local branch
t/16800/e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994...
Traceback (most recent call last):
File "/opt/sage/sage-6.3/git-trac-command/bin/git-trac", line 18, in
<module>
cmdline.launch()
File "/opt/sage/sage-6.3/git-trac-command/git_trac/cmdline.py", line
204, in launch
app.checkout(args.ticket_or_branch, args.branch_name)
File "/opt/sage/sage-6.3/git-trac-command/git_trac/app.py", line 98,
in checkout
self._checkout_ticket(int(ticket_or_branch), branch_name)
File "/opt/sage/sage-6.3/git-trac-command/git_trac/app.py", line 122,
in _checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
File
"/opt/sage/sage-6.3/git-trac-command/git_trac/git_repository.py", line
123, in checkout_new_branch
self.git.fetch('trac', remote)
File "/opt/sage/sage-6.3/git-trac-command/git_trac/git_interface.py",
line 341, in meth
return self.execute(git_cmd, *args, **kwds)
File "/opt/sage/sage-6.3/git-trac-command/git_trac/git_interface.py",
line 328, in execute
popen_stderr=subprocess.PIPE)
File "/opt/sage/sage-6.3/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 (128)
when executing "git fetch trac e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994"
STDERR: fatal: 'trac' does not appear to be a git repository
STDERR: fatal: Could not read from remote repository.
STDERR:
STDERR: Please make sure you have the correct access rights
STDERR: and the repository exists.

Jeroen Demeyer

unread,
Aug 13, 2014, 9:51:33 AM8/13/14
to sage...@googlegroups.com
On 2014-08-13 15:35, Jeroen Demeyer wrote:
> STDERR: fatal: 'trac' does not appear to be a git repository
> STDERR: fatal: Could not read from remote repository.
> STDERR:
> STDERR: Please make sure you have the correct access rights
> STDERR: and the repository exists.

The problem seems to be "git remote" configuration (which is mentioned
near the *bottom* of
https://github.com/sagemath/git-trac-command/blob/master/README.md but
it should probably be in the Installation section)

Originally I had

$ git remote -v
origin git://github.com/sagemath/sage.git (fetch)
origin git://github.com/sagemath/sage.git (push)

After doing git trac --user=jdemeyer (I only want read-only access and I
don't want to store my password or ssh key on this machine), I have

jdemeyer@sage3:/opt/sage/sage-6.3$ git remote -v
origin git://github.com/sagemath/sage.git (fetch)
origin git://github.com/sagemath/sage.git (push)
trac git://trac.sagemath.org/sage.git (fetch)
trac g...@trac.sagemath.org:sage.git (push)

which still doesn't work, the following command fails without any output
or error message:

$ git fetch trac e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994

Now let's do as suggested for read-only access in
https://github.com/sagemath/git-trac-command/blob/master/README.md#configuration

$ git remote rm trac
$ git remote add trac http://trac.sagemath.org/sage.git
STDERR: error: no such remote ref
e4cfbba3cdbda98fbb772f1dc5b1a6b40cae7994

So I'm still stuck here...

Volker Braun

unread,
Aug 13, 2014, 10:29:46 AM8/13/14
to sage...@googlegroups.com
It is by design that you cannot git fetch by sha1. Only named commits can be retrieved from a remote git server.

Its true that this opens up a small gap where you cannot get a closed ticket branch without looking at the ticket history to see the original branch name. We could leave the name of the branch when closing tickets, and/or replace the branch by the commit sha1 only later. 

Jeroen Demeyer

unread,
Aug 13, 2014, 10:56:13 AM8/13/14
to sage...@googlegroups.com
On 2014-08-13 16:29, Volker Braun wrote:
> It is by design that you cannot git fetch by sha1. Only named commits
> can be retrieved from a remote git server.
Thanks for the info, I solved the problem by first doing

$ git fetch trac

and then you can use the sha1 in the usual way.

Volker Braun

unread,
Aug 13, 2014, 11:06:00 AM8/13/14
to sage...@googlegroups.com
That probably worked because another branch has the commit sha1 in its history. Once you download it you can access it locally, of course.

Volker Braun

unread,
Aug 13, 2014, 11:08:34 AM8/13/14
to sage...@googlegroups.com
On Wednesday, August 13, 2014 4:06:00 PM UTC+1, Volker Braun wrote:
That probably worked because another branch has the commit sha1 in its history. Once you download it you can access it locally, of course

In particular, if the original branch is still on the trac server then downloading all branches will include it.
Reply all
Reply to author
Forward
0 new messages