如何排除文件&来自git diff --no-index
的目录?
例如,我想显示两个目录project1
和&之间的差异。 project2
忽略了他们的顶级.git
目录(project1/.git
& project2/.git
)及其所有.DS_Store
个文件。
答案 0 :(得分:0)
这不完全符合您的要求,但它可能会为您提供所需的结果:将project2
添加为project1
的远程,并将git diff
HEAD
添加为import matplotlib.pylab as plt
import pandas as pd
efficiency = [{'weights': '21', 'sets': '5', 'time': '1', 'machine': 'a'},
{'weights': '93', 'sets': '25', 'time': '2', 'machine': 'a'},
{'weights': '53', 'sets': '5', 'time': '1', 'machine': 'b'},
{'weights': '61', 'sets': '25', 'time': '2', 'machine': 'b'},
{'weights': '66', 'sets': '5', 'time': '1', 'machine': 'c'},
{'weights': '90', 'sets': '25', 'time': '2', 'machine': 'c'},
{'weights': '79', 'sets': '5', 'time': '1', 'machine': 'd'},
{'weights': '100', 'sets': '25', 'time': '1', 'machine': 'd'}]
class Efficiency:
plt.rcParams['figure.figsize'] = (16,6)
def __init__(self, data):
self.data = data
self.machines = []
self.Timestamp = []
for i in data:
setattr(self, 'machine_'+i['machine'], dict(efficiency=[]))
if not i['machine'] in self.machines: self.machines.append(i['machine'])
if not i['time'] in self.Timestamp: self.Timestamp.append(i['time'])
def readData(self):
for i in self.data:
getattr(self, 'machine_' + i['machine'])['efficiency'].append(float(i['weights']))
def plotData(self):
eff_dict = {}
for i in self.machines:
eff_dict['machine ' + i] = getattr(self, 'machine_' + i)['efficiency']
self.df = pd.DataFrame(eff_dict, index= self.Timestamp)
self.df.plot()
plt.grid()
plt.xticks(fontsize=12, rotation=90)
plt.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=12)
plt.tight_layout()
plt.show()
print(self.df)
test = Efficiency(efficiency)
test.readData()
test.plotData()
第