View already-committed Git merge in external 3-way diff tool

Updated answer: My original version of the script below was flawed in the sense that $conflicting_files in fact did not contain only the files that really had conflicts, but all files that were changed in both parent branches (but not necessarily had conflicts). Also, it was not using “the configured merge tool” as advertized in … Read more

Merging a list of time-range tuples that have overlapping time-ranges

A few ways to make it more efficient, Pythonic: Eliminate the set() construction, since the algorithm should prune out duplicates during in the main loop. If you just need to iterate over the results, use yield to generate the values. Reduce construction of intermediate objects, for example: move the tuple() call to the point where … Read more

Can git-svn correctly populate svn:mergeinfo properties?

Even though this is an old question, the current state of affairs with git-svn has changed since it was asked. Specifically, in git 1.7.5, there is some limited support for setting the svn:mergeinfo when dcommitting back to svn. git svn dcommit now accepts the -mergeinfo=<mergeinfo> flag. To quote from the 1.7.5+ man page: -mergeinfo=<mergeinfo> Add … Read more

Merging two CSV files using Python

When I’m working with csv files, I often use the pandas library. It makes things like this very easy. For example: import pandas as pd a = pd.read_csv(“filea.csv”) b = pd.read_csv(“fileb.csv”) b = b.dropna(axis=1) merged = a.merge(b, on=’title’) merged.to_csv(“output.csv”, index=False) Some explanation follows. First, we read in the csv files: >>> a = pd.read_csv(“filea.csv”) >>> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)