Tag: python

Can't run raw git filter-branch

I’m using git–python in one of my projects, and currently I have this code: tpl = “”” if test $GIT_COMMIT = “%s”; then export GIT_AUTHOR_DATE=”%s” export GIT_COMMITTER_DATE=”%s” fi “”” s = “” for commit in filter(lambda x: x[“newdatetime”] is not None, self.commit_datetime): s += tpl % ( commit[“hash”], commit[“newdatetime”].replace(tzinfo = None), commit[“newdatetime”].replace(tzinfo = None) ) […]

How to stop tabs on Python 2.7 RawConfigParser throwing ParsingError?

I am writing a package compatible with both Python 2.7.13 and Python 3.3, and using the following: try: import configparser except: from six.moves import configparser But when I load my .gitmodules file on Python 2.7: configParser = configparser.RawConfigParser( allow_no_value=True ) configFilePath = os.path.join( current_directory, ‘.gitmodules’ ) configParser.read( configFilePath ) It throw the error: Exception in […]

Unable to git add env/bin directory after creating virtualenv

I am really new to Python and the virtualenv needed to set up a project. I dont know whether the directories generated by virtualenv should be gitignored or staged and committed. I narrowed it down to the myproject/env/bin directory that doesn’t seem to want to be staged. After running git add env/bin once I get. […]

Installing xgboost on Anaconda 3 windows-64

I’m struglling yo install xgboost on anaconda 3, on windows 10 64 bits. I followed the instruction of the tutorials at https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=en and https://dnc1994.com/2016/03/installing-xgboost-on-windows/ but I failded to complet the compilation process. I executed the following code (git bash) and everything seems to be ok at this stage: $ git clone –recursive https://github.com/dmlc/xgboost $ cd […]

Git pull using GitPython + SSH keys doesn't work

I am trying to pull a repo from my Github account using GitPython. This is after (1) I performed a git clone already from the command line. (2) Generated new SSH keys using ssh-keygen -t rsa -b 4096 (3) Setup the contents of the .pub file from #2 above in Github as a new SSH […]

Failed to compile python (Permission denied!) while deploying some changes in heroku

I have deployed a project of github in heroku. Then I successfully cloned the project with my pc using heroku slugs:download -a newocas Now, after making some changes and doing commit while deploying the project back to heroku produces the same error again and again. I’m using git bash for commit and deploy. Here’s my […]

Finding files with both of two specified terms via git grep

I’m attempting to find files in my git repository using git grep and I have no easy way of doing so without manual searching. I have found one workaround like this: git grep -l ‘term1′ | xargs -i grep -l term2 {} But I’m wondering if there is a way similar to this which doesn’t […]

How to update a pull request through Github API

I want to update the title of a pull request and performing the below to achieve it :- (followed this doc https://developer.github.com/v3/pulls/#update-a-pull-request) data = {“title”: “New title”} url=’https://hostname/api/v3/repos/owner/repo/pulls/80′ token = ‘my-token’ headers = {‘Content-type’: ‘application/json’, ‘Accept’: ‘application/json’, ‘Authorization’: ‘token %s’ % token} resp = requests.patch(url, data=json.dumps(data), headers=headers) print resp.json() What am I missing ? Please […]

GIT hook -> Python -> Bash: How to read user input?

I’m doing a GIT hook in Python 3.5. The python script calls a Bash script that that reads input from the user using read command. The bash script by itself works, also when calling directly the python script, but when GIT runs the hook written in Python, it doesn’t work as expected because no user […]

How to handle merges/conflicts in my git based wiki?

I’m working on a django-based wiki. It has section edit capabilities (the sections being delimited by the markdown headers) and it is using git (a single repo) to store the revisions, via the Git Python library. I’m trying to figure out how I can handle several concurrent edits of the same page (using git-python). Thanks,

Git Baby is a git and github fan, let's start git clone.