These are chat archives for astropy/astropy

29th
Apr 2015
Stuart Mumford
@Cadair
Apr 29 2015 15:50
all you people with your gitters
what I ask you is wrong with ASCII over telnet? :P
Thomas Robitaille
@astrofrog
Apr 29 2015 15:50
:-p
all right grandpa, calm down
Stuart Mumford
@Cadair
Apr 29 2015 15:52
lol
open protocols ftw
all I am sayin
@astrofrog did you see my email to the list earlier?
Thomas Robitaille
@astrofrog
Apr 29 2015 15:52
great, it works!
Stuart Mumford
@Cadair
Apr 29 2015 15:53
what works?!
Thomas Robitaille
@astrofrog
Apr 29 2015 15:53
notifications
sorry :-/
did you email astropy-dev?
didn't see it
or sunpy list?
Stuart Mumford
@Cadair
Apr 29 2015 15:53
I thought it was astropy-dev
Brett M. Morris
@bmorris3
Apr 29 2015 15:54
Hi Thomas, sorry about that
Thomas Robitaille
@astrofrog
Apr 29 2015 15:54
@Cadair - nope, it's not there: https://groups.google.com/forum/#!forum/astropy-dev
@bmorris3 - no worries! Easier to go through a rebase interactively with someone the first time :)
@bmorris3 - can you show me the output of git remote -v
?
Brett M. Morris
@bmorris3
Apr 29 2015 15:55
I had a merge conflict in astropy/init.py which I tried to resolve and left an extra line in.
origin git@github.com:bmorris3/astropy.git (fetch)
origin git@github.com:bmorris3/astropy.git (push)
upstream git@github.com:astropy/astropy.git (fetch)
upstream git@github.com:astropy/astropy.git (push)
Thomas Robitaille
@astrofrog
Apr 29 2015 15:55
The issue is actually also that there are other unrelated commits and yours appear twice: https://github.com/astropy/astropy/pull/3696/commits
ok thanks
so to start off, do:
git fetch upstream
Brett M. Morris
@bmorris3
Apr 29 2015 15:56
Got it, done
Thomas Robitaille
@astrofrog
Apr 29 2015 15:56
then once that's done, do
git rebase -i upstream/master
it should put up some kind of vi window in the terminal with a list of commits, do you see that?
Brett M. Morris
@bmorris3
Apr 29 2015 15:57
Yup, I'm there
Thomas Robitaille
@astrofrog
Apr 29 2015 15:57
if so, can you paste the contents of that window here?
Brett M. Morris
@bmorris3
Apr 29 2015 15:57
pick a92768e updated printwcs() method to call repr()
pick 169ddd1 rebasing, updating repr method for wcs
pick 0738a4c Reverting to original init file to isolate separate PRs
pick 0663af8 updated printwcs() method to call repr()

Rebase c37f2a6..024b16d onto c37f2a6

Sorry, I should be taking full advantage of markdown
Thomas Robitaille
@astrofrog
Apr 29 2015 15:58
btw you can use syntax highlighting here - on the right of this box there is a switch to compose mode button - then you can put code in triple back-quotes and press command-enter to send
Brett M. Morris
@bmorris3
Apr 29 2015 15:58
Got it, I've never used markdown in a chat before, this is great.
Thomas Robitaille
@astrofrog
Apr 29 2015 15:58
yep :)
Stuart Mumford
@Cadair
Apr 29 2015 15:58
grumble grumble
Thomas Robitaille
@astrofrog
Apr 29 2015 15:58
but anyway let's try and proceed with the rebase since I think that will already get rid of the unrelated commits. So to continue, do :wq in the vi window
@bmorris3, meet @Cadair, he is a time traveller from the 1800s
telnet etc.
;)
Did the rebase complete?
Brett M. Morris
@bmorris3
Apr 29 2015 15:59
Hi @Cadair , welcome to the future
I haven't done it yet -- I shouldn't delete any of those commits?
Thomas Robitaille
@astrofrog
Apr 29 2015 16:00
No, not for now, let's do a first pass to get rid of other people's commits, which is what this will do
Brett M. Morris
@bmorris3
Apr 29 2015 16:00
ok, great
Thomas Robitaille
@astrofrog
Apr 29 2015 16:00
let me know once it's completed
Brett M. Morris
@bmorris3
Apr 29 2015 16:00
And we get:
Automatic cherry-pick failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>', and
run 'git rebase --continue'
Could not apply 0738a4c... Reverting to original __init__ file to isolate separate PRs
Thomas Robitaille
@astrofrog
Apr 29 2015 16:01
Ok can you check the contents of __init__.py and paste them here?
Brett M. Morris
@bmorris3
Apr 29 2015 16:02
Near the conflict:
<<<<<<< HEAD
# Set the bibtex entry to the article referenced in CITATION
def _get_bibtex():
    import os
    import re
    if os.path.exists('CITATION'):
        with open('CITATION', 'r') as citation:
            refcontents = re.findall(r'\{[^()]*\}', citation.read())[0]
            bibtexreference = "@ARTICLE{0}".format(refcontents)
        return bibtexreference
    else:
        return ''

__bibtex__ = _get_bibtex()
=======

>>>>>>> 0738a4c... Reverting to original __init__ file to isolate separate PRs


import logging
Thomas Robitaille
@astrofrog
Apr 29 2015 16:02
ok perfect - so basically just tidy it up to make it look like:
# Set the bibtex entry to the article referenced in CITATION
def _get_bibtex():
    import os
    import re
    if os.path.exists('CITATION'):
        with open('CITATION', 'r') as citation:
            refcontents = re.findall(r'\{[^()]*\}', citation.read())[0]
            bibtexreference = "@ARTICLE{0}".format(refcontents)
        return bibtexreference
    else:
        return ''

__bibtex__ = _get_bibtex()


import logging
then git add astropy/__init__.py and then git rebase --continue
Any luck?
I'm not really sure why there was a conflict in __init__.py in the first place, but no worries :)
Brett M. Morris
@bmorris3
Apr 29 2015 16:03
[bmmorris@mist astropy]$ git rebase --continue
[detached HEAD ca13900] Reverting to original __init__ file to isolate separate PRs
 1 files changed, 1 insertions(+), 0 deletions(-)
Finished one cherry-pick.
# Not currently on any branch.
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   astropy_helpers (new commits)
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    astropy/updatedinit.py
#    test.py
no changes added to commit (use "git add" and/or "git commit -a")
Could not apply 0663af8... updated printwcs() method to call repr()
Thomas Robitaille
@astrofrog
Apr 29 2015 16:04
Ok I think we're now running into the duplicate commits
Brett M. Morris
@bmorris3
Apr 29 2015 16:05
It seems that way.
Thomas Robitaille
@astrofrog
Apr 29 2015 16:05
can you do git status
Brett M. Morris
@bmorris3
Apr 29 2015 16:05
[bmmorris@mist astropy]$ git status
# Not currently on any branch.
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   astropy_helpers (new commits)
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    astropy/updatedinit.py
#    test.py
no changes added to commit (use "git add" and/or "git commit -a")
Thomas Robitaille
@astrofrog
Apr 29 2015 16:05
ok let's get rid of that astropy_helpers change, it's not related - so do:
git submodule update

then

git status

again

Brett M. Morris
@bmorris3
Apr 29 2015 16:06
[bmmorris@mist astropy]$ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    astropy/updatedinit.py
#    test.py
nothing added to commit but untracked files present (use "git add" to track)
Thomas Robitaille
@astrofrog
Apr 29 2015 16:06
Ok perfect, now
git rebase --continue
Brett M. Morris
@bmorris3
Apr 29 2015 16:06
woo!
[bmmorris@mist astropy]$ git rebase --continue
Successfully rebased and updated refs/heads/wcs.
Thomas Robitaille
@astrofrog
Apr 29 2015 16:07
Perfect, so this is part 1 done - push the changes with
git push -f origin wcs
Part 2 is easier
;)
Brett M. Morris
@bmorris3
Apr 29 2015 16:07
Forced update is done
Thomas Robitaille
@astrofrog
Apr 29 2015 16:08

Ok so now let's tidy up the commits. Do

git rebase -i upstream/master

again and show me the vi window

Brett M. Morris
@bmorris3
Apr 29 2015 16:08
Thanks again for walking me through this, most of my git experience is on projects with much slower development so these problems didn't happen often.
pick a92768e updated printwcs() method to call repr()
pick 169ddd1 rebasing, updating __repr__ method for wcs
pick ca13900 Reverting to original __init__ file to isolate separate PRs

# Rebase c37f2a6..ca13900 onto c37f2a6
Thomas Robitaille
@astrofrog
Apr 29 2015 16:09
Ok so on line 2 and 3, change pick to squash which means we'll combine the commit with the previous one to leave just one commit. Then do :wq and it should then come up with a vi window to edit the commit message, do you see that?
Brett M. Morris
@bmorris3
Apr 29 2015 16:10
Yes
Thomas Robitaille
@astrofrog
Apr 29 2015 16:10
Ok now edit that to leave only the original message (updated printwcs() method to call repr()) and get rid of the other messages below - are you familiar with vi commands?
Brett M. Morris
@bmorris3
Apr 29 2015 16:10
Yes I am. I'm on it
Thomas Robitaille
@astrofrog
Apr 29 2015 16:10
Ok thanks - just didn't want to assume :)
Brett M. Morris
@bmorris3
Apr 29 2015 16:11
As any good teacher would :D. Successfully rebased!
Thomas Robitaille
@astrofrog
Apr 29 2015 16:11
Ok perfect, and one more thing now - we should get rid of the whitespace change in __init__.py, so to do that we can do a:
git commit --amend
Brett M. Morris
@bmorris3
Apr 29 2015 16:12
Ok,
Thomas Robitaille
@astrofrog
Apr 29 2015 16:12
ah no wait sorry it's a slightly different command, just a sec (you can just :wq the window that did come up)
Brett M. Morris
@bmorris3
Apr 29 2015 16:13
I was curious where that was heading ;)
Thomas Robitaille
@astrofrog
Apr 29 2015 16:14
Ah right sorry I was getting confused - you have to first make the change (I often use a GUI instead), so go to astropy/__init__.py and remove the empty line on line 299
then do:
git commit --amend
and save the change
sorry forgot one more thing, after making the edit you have to first do
git add astropy/__init__.py
to add the change as one normally would, then do the amend command. Does that work?
Brett M. Morris
@bmorris3
Apr 29 2015 16:16
I think the line is already gone
checked in both gedit and vi, it's not there
Thomas Robitaille
@astrofrog
Apr 29 2015 16:17
ah ok - well in that case force push again to the remote branch
Brett M. Morris
@bmorris3
Apr 29 2015 16:18
Done
Thomas Robitaille
@astrofrog
Apr 29 2015 16:19
Thanks! Interesting the added line is still there: https://github.com/astropy/astropy/pull/3696/files
Brett M. Morris
@bmorris3
Apr 29 2015 16:20
hmm, I don't understand why
Thomas Robitaille
@astrofrog
Apr 29 2015 16:20
checking here
what do you get for
git status
Brett M. Morris
@bmorris3
Apr 29 2015 16:21
# On branch wcs
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    astropy/updatedinit.py
#    test.py
nothing added to commit but untracked files present (use "git add" to track)
Thomas Robitaille
@astrofrog
Apr 29 2015 16:23
Ok and you definitely see the following on line 298/299, i.e. no space?
                          sp.returncode))
# Set the bibtex entry to the article referenced in CITATION
I see a space in your branch when I check it out here
I see
                          sp.returncode))

# Set the bibtex entry to the article referenced in CITATION
Brett M. Morris
@bmorris3
Apr 29 2015 16:24
Ahh I'm so sorry, I was looking at the mistaken line break at the end of the file, which was included in an earlier commit
Thomas Robitaille
@astrofrog
Apr 29 2015 16:24
Np :) So make the fix, git add it then git commit --amend and force push
Brett M. Morris
@bmorris3
Apr 29 2015 16:25
What I see is this:
                          sp.returncode))

# Set the bibtex entry to the article referenced in CITATION
def _get_bibtex():
    import os
    import re
    if os.path.exists('CITATION'):
        with open('CITATION', 'r') as citation:
            refcontents = re.findall(r'\{[^()]*\}', citation.read())[0]
            bibtexreference = "@ARTICLE{0}".format(refcontents)
        return bibtexreference
    else:
        return ''

__bibtex__ = _get_bibtex()


import logging
alright, fixing it up.
Thomas Robitaille
@astrofrog
Apr 29 2015 16:26
Yep so get rid of the empty line above #Set the bibtex entry...
Brett M. Morris
@bmorris3
Apr 29 2015 16:26
force pushed
Thomas Robitaille
@astrofrog
Apr 29 2015 16:27
Perfect, thanks! Takes a little while to get used to git, but the good news is that it's always fixable :)
Brett M. Morris
@bmorris3
Apr 29 2015 16:27
Thanks again for your help!
Thomas Robitaille
@astrofrog
Apr 29 2015 16:27
Np!
Brett M. Morris
@bmorris3
Apr 29 2015 16:28
I'm off to teach a class, but I'd be happy to experiment with other citation methods too, I think self-citing code is a tangible ideal. Keep me in the loop!
Thomas Robitaille
@astrofrog
Apr 29 2015 16:33
Ok sounds good! :)
Kelle Cruz
@kelle
Apr 29 2015 20:12
hey...did yall see this new Stackoverflow question? It was also posted to the FB group: http://stackoverflow.com/questions/29950918/astropy-io-fits-hierarch-keywords-dont-work-with-continue-cards-bug-or-feat
I dont know who the right person is to answer it...so i'm sending up the astropy bat signal here.