Opened 9 years ago

Closed 8 years ago

#14144 closed defect (wontfix)

Print current branch name (again)

Reported by: jhpalmieri Owned by: tbd
Priority: major Milestone: sage-6.2
Component: interfaces Keywords:
Cc: Merged in:
Authors: John Palmieri Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Another issue with the new IPython: if someone has cloned their Sage library, then previous versions of Sage would print the branch name on startup:

Loading Sage library. Current Mercurial branch is: my-branch

With #12719, the branch no longer prints on startup. The sage-combinat group, for example, use branches all the time, so this behavior should be restored.

Attachments (2)

trac_14144-branch.patch (1.2 KB) - added by jhpalmieri 9 years ago.
trac_14144-branch-nodoctest.patch (1.6 KB) - added by jhpalmieri 9 years ago.

Download all attachments as: .zip

Change History (19)

Changed 9 years ago by jhpalmieri

comment:1 Changed 9 years ago by jhpalmieri

  • Status changed from new to needs_review

Did I do this right? It works for me in limited testing.

comment:2 Changed 9 years ago by vbraun

In general, I don't think its a good idea to make the startup banner depend on any externalities. The more miscellaneous stuff you print at startup, the more likely you are to break the sage<->sage interface or doctests for a few users with a peculiar setup.

For the record, I removed the branch printing in #14024 because it was broken and nobody noticed (until it hit my patchbot, which uses branches).

I don't mind putting it back in, but is view of the switch to git I don't think its worth the effort.

comment:3 Changed 9 years ago by jhpalmieri

I don't use branches, so it doesn't affect me, but the sage-combinat script starts by making a clone of the Sage library. So anyone who uses that uses branches. It seems like an overly hasty decision to stop printing the branches, since it affects a large group of people.

comment:4 Changed 9 years ago by vbraun

  • Component changed from PLEASE CHANGE to packages

I agree that it'll be a cosmetic change in the startup banner for users of the combinat queue, but I fail to see the issue. If you switch branches regularly then you probably know which one you are on (and can be found out easier than to start Sage and look at the banner; its wrong to train our users to rely on that). If you just use Sage then its of no concern to you whether the sage-combinat script made a branch or not.

comment:5 Changed 9 years ago by jdemeyer

  • Type changed from PLEASE CHANGE to defect

comment:6 Changed 9 years ago by jhpalmieri

Here's a variation on the first patch, which I hope won't interfere with doctesting.

comment:7 Changed 9 years ago by jdemeyer

  • Component changed from packages: standard to interfaces

comment:8 Changed 9 years ago by jdemeyer

  • Summary changed from more IPython 0.13 issues to Print current branch name (again)

comment:9 Changed 9 years ago by kcrisman

Dare I ask if this needs a doctest? Perhaps it's not possible, but then we should somehow indicate this...

comment:10 Changed 9 years ago by vbraun

I think there is no point in working on this ticket, work on the git transition instead.

comment:11 Changed 9 years ago by kcrisman

Well, perhaps one should say that those working on the git transition should work on the git transition. If that goes for another year (which seems plausible if only one person is currently working hard on it) then this ticket is useful.

comment:12 Changed 9 years ago by jhpalmieri

Re a doctest: the code says

if (not DOCTEST_MODE) and branch: 
    print branch 

so I don't know how to make a doctest that will reveal anything helpful. Here's an updated version with a longer docstring.

Changed 9 years ago by jhpalmieri

comment:13 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:14 Changed 8 years ago by ncohen

  • Status changed from needs_review to needs_info

Hmmmm... With the first git release planned for the end of the year, does this still make sense ? I've been using sage-git for a while myself and there are no branches there ^^; I mean. Not the same kind ^^;


comment:15 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:16 Changed 8 years ago by jhpalmieri

Should we close this ticket? Is there any reason we should be printing the git branch as part of the banner? (I'm happy to close it.)

comment:17 Changed 8 years ago by vbraun

  • Resolution set to wontfix
  • Reviewers set to Volker Braun
  • Status changed from needs_info to closed

If you want to keep track of the git branch then I'd recommend putting it in the bash prompt (#15590). Thats what I'm using personally. Bonus: works for other projects using git, too.

Note: See TracTickets for help on using tickets.