No access to trac via git-trac ?

90 views
Skip to first unread message

Emmanuel Charpentier

unread,
Jul 10, 2019, 9:55:05 AM7/10/19
to sage-devel
trac.sagemath.org is accessible via its Web interface. However, a (correctly configured) "git trac" command is inable to checkout a (currently empty) ticket :

charpent@p-202-021:/usr/local/sage-python3$ git trac checkout 28151
Loading ticket #28151...
Newly created local branch: t/28151/upgrade_r_to_3_6_1
Traceback (most recent call last):
  File "/usr/local/bin/git-trac", line 17, in <module>
    cmdline.launch()
  File "/home/charpent/Dev/git-trac-command/git_trac/cmdline.py", line 220, in launch
    app.checkout(args.ticket_or_branch, args.branch_name)
  File "/home/charpent/Dev/git-trac-command/git_trac/app.py", line 118, in checkout
    self._checkout_ticket(int(ticket_or_branch), branch_name)
  File "/home/charpent/Dev/git-trac-command/git_trac/app.py", line 136, in _checkout_ticket
    self.repo.create(local)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py", line 144, in create
    self.git.fetch('trac', starting_branch)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 340, in meth
    return self.execute(git_cmd, *args, **kwds)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 327, in execute
    popen_stderr=subprocess.PIPE)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 262, in _run
    raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>

Server problem ?

Same results after refreshing my git-trac-command directory (via git fetch and git pull...)..

Hints ?

Dima Pasechnik

unread,
Jul 10, 2019, 10:08:04 AM7/10/19
to sage-devel
One cannot checkout an empty branch, IMHO. I can certainly fetch
branches from trac's git server, i.e. (with ssh)
g...@trac.sagemath.org:sage.git


>
> Hints ?
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a3179157-cfd4-46bb-ae7a-c51cdcd6e968%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Emmanuel Charpentier

unread,
Jul 10, 2019, 10:38:30 AM7/10/19
to sage-devel
I don't understand : I created (successfully) https://trac.sagemath.org/ticket/28151 but I can't check it out as I did usually. This behaviour isn't the one described in the Developer's guide, which I've successfully used in the past.

BTW, trying to create a "private" ticket (u/charpent/whatever...) as described here, I get another error :

charpent@p-202-021:/usr/local/sage-python3$ git trac create 'Upgrade R to 3.6.1'
Remote branch: u/charpent/upgrade_r_to_3_6_1
Newly-created ticket number: 28157
Local branch: t/28157/upgrade_r_to_3_6_1
Traceback (most recent call last):
  File "/usr/local/bin/git-trac", line 17, in <module>
    cmdline.launch()
  File "/home/charpent/Dev/git-trac-command/git_trac/cmdline.py", line 237, in launch
    app.create(args.summary, args.branch_name)
  File "/home/charpent/Dev/git-trac-command/git_trac/app.py", line 239, in create
    self.repo.create(local)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py", line 144, in create
    self.git.fetch('trac', starting_branch)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 340, in meth
    return self.execute(git_cmd, *args, **kwds)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 327, in execute
    popen_stderr=subprocess.PIPE)
  File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 262, in _run
    raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>

This new ticket *can* be accessed from the Web interface to Trac and is totally virgin.

BTW : none of my attempts has created any local branch :

charpent@p-202-021:/usr/local/sage-python3$ git branch
* develop
  master


I'm stuck... Without further information, I can but conclude that Trac is somehow hosed...
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

E. Madison Bray

unread,
Jul 10, 2019, 11:03:12 AM7/10/19
to sage-devel
The problems you're experiencing don't appear to have anything to do with Trac, but rather with the `git trac` command's attempts to run commands in your local git repository. 

Unfortunately, due to a different bug (which I've seen before but I don't think has been fixed) instead of seeing what the error message was from git, you just a useless
<exception str() failed>


You could try inserting a breakpoint where it's running the git command, and see what command it's actually running, then run it manually yourself and see what's up. 

Or just manually do 

$ git fetch
$ git checkout --track origin/<branch-name>

which is likely all it's doing anyways. 






To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.

Dima Pasechnik

unread,
Jul 10, 2019, 11:58:44 AM7/10/19
to sage-devel
IMHO "git trac" can create trac tickets for you, but if one created a ticket  by hand then, unless there is a branch already, "git trac checkout" may get confused...

To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.

Emmanuel Charpentier

unread,
Jul 10, 2019, 12:24:00 PM7/10/19
to sage-devel
Hmmm... The web page of the ticket  created via the Web interface exists ; ditto for the one created from my system via git trac create, but the corresponding git branch doesn't seem to have been created :

charpent@p-202-021:/usr/local/sage-python3$ git fetch
charpent@p-202-021:/usr/local/sage-python3$ git branch --remote | grep 3_6
  origin/public/packages/openblas_0_3_6
  origin/u/charpent/upgrade_r_to_3_6_0
  origin/u/jdemeyer/aborted_tests_on_macos_10_13_6
  origin/u/vbraun/openblas_0_3_6
  origin/u/vbraun/openblas_0_3_6_vs__os_x
  origin/u/vbraun/upgrade_to_python_3_6_6

Still stuck. Oh, well...

Simon King

unread,
Jul 10, 2019, 7:11:36 PM7/10/19
to sage-...@googlegroups.com
Hi Dima,

On 2019-07-10, Dima Pasechnik <dim...@gmail.com> wrote:
> IMHO "git trac" can create trac tickets for you, but if one created a
> ticket by hand then, unless there is a branch already, "git trac checkout"
> may get confused...

Normally, I create the ticket manually and then do "git trac checkout",
and it works.

Cheers,
Simon

Emmanuel Charpentier

unread,
Jul 11, 2019, 2:04:00 AM7/11/19
to sage-devel
That's what I did (and what failed...)
 

Cheers,
Simon

Emmanuel Charpentier

unread,
Jul 11, 2019, 5:18:56 AM7/11/19
to sage-devel
I think that something is havoc : using a sage tree compiled with Python 3,
another attempt ti git trac checkout 28151 fails as before, 
another attempt to create a new ticket fails as before (but a newly created tickets (28163) appears on the Web interface to trac).

Furthermore :

charpent@p-202-021:/usr/local/sage-python3$ git branch --remote | grep 2815
  origin/u/chapoton/28153
  origin/u/embray/ticket-28154

However, perusing the Web interface shows that *all* tickets #2815[[:digit:]] are accessible...

Going back to my last Python2 compilation of Sage (and re-symlinking to it), git checkout 28151 works like a charm.

The problem seems to be that git-trac isn't compatible with Python 3 or whatever happens in a Python 3-based Sage... I'm filing an issue against it on its Github repository.

Any hints or advice ?

Emmanuel Charpentier

unread,
Jul 11, 2019, 10:53:59 AM7/11/19
to sage-devel
FWIW :

after getting back to a Python2-based Sage, I have been able to get my ticket, patch Sage, check it, commit and push to Trac. THEN AND ONLY THEN, I have been able to return to my Python3-based sage, manually create a branch based on the Trc branch, check it out and compile to check the results under Python3.

This workaround is a bit heavy for my taste...

--
Emmanuel Charpentier

Dima Pasechnik

unread,
Jul 11, 2019, 11:48:10 AM7/11/19
to sage-devel
ok, so 'git trac' is not py3 clean, I gather...

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.

E. Madison Bray

unread,
Jul 11, 2019, 3:53:03 PM7/11/19
to sage-devel
On Thu, Jul 11, 2019 at 4:54 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
>
> FWIW :
>
> after getting back to a Python2-based Sage, I have been able to get my ticket, patch Sage, check it, commit and push to Trac. THEN AND ONLY THEN, I have been able to return to my Python3-based sage, manually create a branch based on the Trc branch, check it out and compile to check the results under Python3.

I'm surprised that this is problem since I thought git-trac would use
the system Python, and not the one actually installed in Sage, but I'm
not sure. Is that how you have it set up? I suspect it's not
necessary. But maybe it is. Either way it should definitely be fixed
to work on Python 3 if it doesn't.

>
> This workaround is a bit heavy for my taste...

Not to be glib, but another very simple workaround would be to simply
not use `git trac` if it's just for one thing. If your goal was just
to check out a branch it's really not necessary, and for the purposes
of working on other projects I think it behooves anyone to work on
learning git (which I will fully admit is not often fun to do, though
I enjoy this tutorial: https://learngitbranching.js.org/

Emmanuel Charpentier

unread,
Jul 12, 2019, 5:26:49 AM7/12/19
to sage-devel
The plot thickens...

This morning, upgrading another machine (Debian testing, too), after "git fetch ; git pull", I tried "git trac checkout 28151" for the hell of it and ... it worked flawlessly. Compiled fine, ptest-python3 in progress (no trouble so far).

I despair understanding this one...

Emmanuel Charpentier

unread,
Jul 12, 2019, 5:27:27 AM7/12/19
to sage-devel


Le jeudi 11 juillet 2019 17:48:10 UTC+2, Dima Pasechnik a écrit :
ok, so 'git trac' is not py3 clean, I gather...

Possibly (see my newer post)... 

To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

Emmanuel Charpentier

unread,
Jul 12, 2019, 5:38:07 AM7/12/19
to sage-devel


Le jeudi 11 juillet 2019 21:53:03 UTC+2, E. Madison Bray a écrit :
On Thu, Jul 11, 2019 at 4:54 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
>
> FWIW :
>
> after getting back to a Python2-based Sage, I have been able to get my ticket, patch Sage, check it, commit and push to Trac. THEN AND ONLY THEN, I have been able to return to my Python3-based sage, manually create a branch based on the Trc branch, check it out and compile to check the results under Python3.

I'm surprised that this is problem since I thought git-trac would use
the system Python, and not the one actually installed in Sage, but I'm
not sure.  Is that how you have it set up?

Yep. My git-trac-command clone of the repository lives somewhere in my personal tree, and its git-trac file is symlinked to /usr/local/bin.

And my default Python is still Python2 (Debian dixit).
 
 I suspect it's not
necessary. But maybe it is.  Either way it should definitely be fixed
to work on Python 3 if it doesn't.

Hmmm... I'm no longer sure that this is  a 2vs3 problem (see my newer post). 

>
> This workaround is a bit heavy for my taste...

Not to be glib, but another very simple workaround would be to simply
not use `git trac` if it's just for one thing.  If your goal was just
to check out a branch

My goal was to check out the ticket, work on it, check it, commit *and bush it back at the right place*. The latter task is eased by git track : no guessing where I should put my new shiny branch, no question on how to update the ticket...
 
it's really not necessary, and for the purposes
of working on other projects I think it behooves anyone to work on
learning git (which I will fully admit is not often fun to do, though
I enjoy this tutorial: https://learngitbranching.js.org/

I did learn git (or, more precisely, started to learn it). I was able to *guess* the right name of the brach created for my ticket.

But this dance around Trac infrastructure shouldn't have been necessary.


> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

E. Madison Bray

unread,
Jul 12, 2019, 12:41:48 PM7/12/19
to sage-devel
On Fri, Jul 12, 2019 at 11:26 AM Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:
>
> The plot thickens...
>
> This morning, upgrading another machine (Debian testing, too), after "git fetch ; git pull", I tried "git trac checkout 28151" for the hell of it and ... it worked flawlessly. Compiled fine, ptest-python3 in progress (no trouble so far).
>
> I despair understanding this one...

As I previously suggested there might have just been a problem with the state of that particular git repository you were working in, except as also stated the git-trac script doesn't give a very helpful error message if something goes wrong.  I suggested that you put a breakpoint (`import pdb; pdb.set_trace()`) in the script close to where it executes the git commands to see what the actual error from git was.

> But this dance around Trac infrastructure shouldn't have been necessary.

Again, I don't think this has anything to do with Trac.  You can name a branch anything you like.  While I agree it's nice to be able to work entirely from command-line, you don't have to "guess" what the name of a branch is.  If you look at a ticket on Trac it will tell you what branch, if any, is attached to it.  And then you can copy/paste that branch name and run `git checkout --track <remote>/<branch-name>` directly.

I get the convenience of git-trac, but I think it's also good, when it comes to higher level convenience tools, not to get overly attached to them as the only way to do things, especially if it's something totally non-standard used by exactly one project (as opposed to something like `hub` which is a popular command-line interface for GitHub; but even then if something goes even slightly awry in your git repository hub won't be able to help you without getting your hands dirty with plain git...).



> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
Reply all
Reply to author
Forward
0 new messages