Discussion:
[sage-devel] git trac fails to checkout a remote branch
Emmanuel Charpentier
2018-11-29 22:27:04 UTC
Permalink
Trying to test Trac#26791 <https://trac.sagemath.org/ticket/26791> :

***@zen-book-flip:/usr/local/sage-8$ git trac checkout 26791
Loading ticket #26791...
Checking out Trac #26791 remote branch u/gh-timokau/rpy2-build-typo ->
local branch t/26791/rpy2-build-typo...
Traceback (most recent call last):
File "/usr/local/bin/git-trac", line 18, 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 146, in
_checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py",
line 136, in checkout_new_branch
self.git.fetch('trac', remote)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 341, in meth
return self.execute(git_cmd, *args, **kwds)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 328, in execute
popen_stderr=subprocess.PIPE)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 263, in _run
raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>

Suggestions ?
--
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.
For more options, visit https://groups.google.com/d/optout.
Dima Pasechnik
2018-11-29 22:34:10 UTC
Permalink
Use plain git.
Suppose you're on branch called foo

git fetch trac u/gh-timokau/rpy2-build-typo
git checkout -b rpy2-build-typo FETCH_HEAD

at this point you have created a local branch called rpy2-build-typo
which is more or less what trac extension is supposed to do.
Test is, and then do

git checkout foo

to get back


On Thu, Nov 29, 2018 at 10:27 PM Emmanuel Charpentier
Post by Emmanuel Charpentier
Loading ticket #26791...
Checking out Trac #26791 remote branch u/gh-timokau/rpy2-build-typo -> local branch t/26791/rpy2-build-typo...
File "/usr/local/bin/git-trac", line 18, 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 146, in _checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py", line 136, in checkout_new_branch
self.git.fetch('trac', remote)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 341, in meth
return self.execute(git_cmd, *args, **kwds)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 328, in execute
popen_stderr=subprocess.PIPE)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 263, in _run
raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>
Suggestions ?
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
--
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.
For more options, visit https://groups.google.com/d/optout.
Emmanuel Charpentier
2018-11-29 22:43:18 UTC
Permalink
The problem might be on trac : git branch --remote | grep 26791 diesn't
return anything...
Post by Emmanuel Charpentier
Loading ticket #26791...
Checking out Trac #26791 remote branch u/gh-timokau/rpy2-build-typo ->
local branch t/26791/rpy2-build-typo...
File "/usr/local/bin/git-trac", line 18, 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 146, in
_checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py",
line 136, in checkout_new_branch
self.git.fetch('trac', remote)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 341, in meth
return self.execute(git_cmd, *args, **kwds)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 328, in execute
popen_stderr=subprocess.PIPE)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py",
line 263, in _run
raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>
Suggestions ?
--
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.
For more options, visit https://groups.google.com/d/optout.
Dima Pasechnik
2018-11-29 22:45:43 UTC
Permalink
On Thu, Nov 29, 2018 at 10:43 PM Emmanuel Charpentier
The problem might be on trac : git branch --remote | grep 26791 diesn't return anything...
Why?

git repo itself does not know anything about trac tickets. It's git
trac extension that tries to match tickets to branches somehow.
Post by Emmanuel Charpentier
Loading ticket #26791...
Checking out Trac #26791 remote branch u/gh-timokau/rpy2-build-typo -> local branch t/26791/rpy2-build-typo...
File "/usr/local/bin/git-trac", line 18, 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 146, in _checkout_ticket
self.repo.checkout_new_branch(ticket.branch, branch)
File "/home/charpent/Dev/git-trac-command/git_trac/git_repository.py", line 136, in checkout_new_branch
self.git.fetch('trac', remote)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 341, in meth
return self.execute(git_cmd, *args, **kwds)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 328, in execute
popen_stderr=subprocess.PIPE)
File "/home/charpent/Dev/git-trac-command/git_trac/git_interface.py", line 263, in _run
raise GitError(result)
git_trac.git_error.GitError: <exception str() failed>
Suggestions ?
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
--
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.
For more options, visit https://groups.google.com/d/optout.
Loading...