Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gitbranch option #37

Merged
merged 2 commits into from
Jan 19, 2018
Merged

Add gitbranch option #37

merged 2 commits into from
Jan 19, 2018

Conversation

rasbt
Copy link
Owner

@rasbt rasbt commented Jan 18, 2018

Adds an option to display the current Git branch via the -b and --gitbranch flags as suggested in #36 .

E.g.,

%load_ext watermark
%watermark -d -b
2018-01-17 
Git branch: test-branch

@ianozsvald
Copy link

Using %watermark -d -m -v -p numpy,matplotlib,pandas -g -b and your githash branch, I can run watermark with no git repo:

The watermark extension is already loaded. To reload it, use:
  %reload_ext watermark
2018-01-18 

CPython 3.6.4
IPython 6.2.1

numpy 1.14.0
matplotlib 2.1.2
pandas 0.22.0

compiler   : GCC 4.8.2 20140120 (Red Hat 4.8.2-15)
system     : Linux
release    : 4.9.75-040975-generic
machine    : x86_64
processor  : x86_64
CPU cores  : 8
interpreter: 64bit
Git hash   : 
Git branch   :

If I add a git init:

Git hash   : 61e46b3582776899406cfd939c3de195320dedac
Git branch   : master

If I then make a branch git checkout -b ian then watermark then I see:

Git hash   : 61e46b3582776899406cfd939c3de195320dedac
Git branch   : ian

I'm using

git version 2.7.4

This all looks pretty sensible.

@rasbt
Copy link
Owner Author

rasbt commented Jan 19, 2018

Thanks for checking! I just see there are two annoying white space characters before the colon. Will fix that and then it's prob. good to go :)

@rasbt rasbt merged commit 7d05c7f into master Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants