Skip to content

Commit 81a4934

Browse files
committed
include env in each commit as file
diffenv was added to this commit.
1 parent ab00d4a commit 81a4934

File tree

7 files changed

+254
-59
lines changed

7 files changed

+254
-59
lines changed
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
2+
diffenv-version: 0.2.0
3+
4+
directory:
5+
6+
listing:
7+
tests: 160, 1565970697.628735, DIR
8+
setup.py: 733, 1565938699.60907, 45a6e791baed384f3973926ab47d7a97
9+
facets: 96, 1565678335.6676767, DIR
10+
examples: 160, 1565526937.9334917, DIR
11+
example_config.yaml: 45, 1564670036.66021, 759eab2b0f2d79bd2c0991820fa76787
12+
dist: 128, 1565525687.4886672, DIR
13+
diffenv.egg-info: 256, 1565525994.236996, DIR
14+
diffenv: 288, 1565938699.608119, DIR
15+
build: 160, 1565525325.6887057, DIR
16+
bin: 96, 1565983913.3839562, DIR
17+
__pycache__: 96, 1564129273.2804494, DIR
18+
README.md: 5488, 1565971150.27754, 910a046ad20caf962e9e1ef33b7a9bdb
19+
MANIFEST.in: 68, 1565686663.53471, edff356a00ba1b5f0660d5514ebb5fb5
20+
LICENSE: 1070, 1563971721.10152, bbd2cb1a41f404058e170e74a725bb18
21+
.vscode: 128, 1565036334.5557442, DIR
22+
.travis.yml: 814, 1565623659.24969, d7278269a9794d1260164b15942c0c60
23+
.gitignore: 1204, 1565984121.26760, 492111bad3319be511a2db1a315e8b6a
24+
.github: 96, 1565526937.9326942, DIR
25+
.diffenv: 192, 1565528757.891121, DIR
26+
.DS_Store: 10244, 1565983486.60602, 1bc2854d0550a6d9a867e8f3d20c1e70
27+
28+
path: /Users/stan/code/diffenv
29+
30+
git:
31+
32+
git-remote: |-
33+
origin git@github.com:error-central/diffenv.git (fetch)
34+
origin git@github.com:error-central/diffenv.git (push)
35+
36+
git-status: |-
37+
On branch master
38+
Your branch is ahead of 'origin/master' by 5 commits.
39+
(use "git push" to publish your local commits)
40+
41+
Changes to be committed:
42+
(use "git reset HEAD <file>..." to unstage)
43+
44+
modified: .gitignore
45+
modified: bin/diffenv
46+
deleted: diffenv/hooks/post-commit
47+
new file: diffenv/hooks/pre-commit
48+
modified: diffenv/hooks/prepare-commit-msg
49+
modified: examples/config-small.yaml
50+
51+
Untracked files:
52+
(use "git add <file>..." to include in what will be committed)
53+
54+
.diffenv/commits/ab00d4ad917201cde332fc279e57ea1fbe2d96f5.yaml
55+
56+
git-user-email: stan@wanderingstan.com
57+
58+
git-user-name: Stan James
59+
60+
version: git version 2.22.0
61+
62+
os:
63+
64+
timezone: 0200
65+
66+
version: Darwin 18.7.0 x86_64
67+
68+
python:
69+
70+
pip-packages:
71+
astroid: 2.2.5
72+
autopep8: 1.4.4
73+
bleach: 3.1.0
74+
certifi: 2019.6.16
75+
chardet: 3.0.4
76+
colorama: 0.4.1
77+
diffenv: 0.2.0
78+
docutils: 0.15.2
79+
gitdb2: 2.0.5
80+
GitPython: 2.1.13
81+
idna: 2.8
82+
importlib-metadata: 0.19
83+
isort: 4.3.21
84+
lazy-object-proxy: 1.4.1
85+
mccabe: 0.6.1
86+
pip: 19.0.3
87+
pkginfo: 1.5.0.1
88+
psutil: 5.6.3
89+
pycodestyle: 2.5.0
90+
Pygments: 2.4.2
91+
pylint: 2.3.1
92+
readme-renderer: 24.0
93+
requests: 2.22.0
94+
requests-toolbelt: 0.9.1
95+
rope: 0.14.0
96+
ruamel.yaml: 0.16.0
97+
ruamel.yaml.clib: 0.1.0
98+
setuptools: 41.0.1
99+
six: 1.12.0
100+
smmap2: 2.0.5
101+
tqdm: 4.33.0
102+
twine: 1.13.0
103+
typed-ast: 1.4.0
104+
urllib3: 1.25.3
105+
webencodings: 0.5.1
106+
wheel: 0.33.4
107+
wrapt: 1.11.2
108+
zipp: 0.5.2
109+
110+
pip3-packages:
111+
astroid: 2.2.5
112+
autopep8: 1.4.4
113+
bleach: 3.1.0
114+
certifi: 2019.6.16
115+
chardet: 3.0.4
116+
colorama: 0.4.1
117+
diffenv: 0.2.0
118+
docutils: 0.15.2
119+
gitdb2: 2.0.5
120+
GitPython: 2.1.13
121+
idna: 2.8
122+
importlib-metadata: 0.19
123+
isort: 4.3.21
124+
lazy-object-proxy: 1.4.1
125+
mccabe: 0.6.1
126+
pip: 19.0.3
127+
pkginfo: 1.5.0.1
128+
psutil: 5.6.3
129+
pycodestyle: 2.5.0
130+
Pygments: 2.4.2
131+
pylint: 2.3.1
132+
readme-renderer: 24.0
133+
requests: 2.22.0
134+
requests-toolbelt: 0.9.1
135+
rope: 0.14.0
136+
ruamel.yaml: 0.16.0
137+
ruamel.yaml.clib: 0.1.0
138+
setuptools: 41.0.1
139+
six: 1.12.0
140+
smmap2: 2.0.5
141+
tqdm: 4.33.0
142+
twine: 1.13.0
143+
typed-ast: 1.4.0
144+
urllib3: 1.25.3
145+
webencodings: 0.5.1
146+
wheel: 0.33.4
147+
wrapt: 1.11.2
148+
zipp: 0.5.2
149+
150+
python-version: Python 3.7.3
151+
152+
python3-version: Python 3.7.3
153+
154+
virtualenv: |
155+
156+
which-python: /usr/local/opt/python/libexec/bin/python
157+
158+
which-python3: /usr/local/bin/python3
159+
160+
shell:
161+
162+
envvars:
163+
AMD_ENTRYPOINT: vs/workbench/services/extensions/node/extensionHostProcess
164+
APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true'
165+
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.obyCxwiqZk/Render
166+
CLICOLOR: '1'
167+
COMMAND_MODE: unix2003
168+
DISPLAY: /private/tmp/com.apple.launchd.iqAX0LXCVg/org.macosforge.xquartz:0
169+
EDITOR: sublw
170+
ELECTRON_RUN_AS_NODE: '1'
171+
GIT_ASKPASS(HASHED): f7f6c93b472769a7f435573524ec859c(HASH)
172+
GIT_AUTHOR_DATE: '@1565984184 +0200'
173+
GIT_AUTHOR_EMAIL: stan@wanderingstan.com
174+
GIT_AUTHOR_NAME: Stan James
175+
GIT_EDITOR: ':'
176+
GIT_EXEC_PATH: /usr/local/Cellar/git/2.22.0/libexec/git-core
177+
GIT_INDEX_FILE: .git/index
178+
GIT_PREFIX: ''
179+
HISTTIMEFORMAT: '%Y-%m-%d_%H-%M-%S; '
180+
HOME: /Users/stan
181+
ISODATETIME: '2019-08-16 13:24:43'
182+
LANG: en_US.UTF-8
183+
LC_ALL: en_US.UTF-8
184+
LOGNAME: stan
185+
LSCOLORS: GxFxCxDxBxegedabagaced
186+
NVM_BIN: /Users/stan/.nvm/versions/node/v10.16.0/bin
187+
NVM_CD_FLAGS: ''
188+
NVM_DIR: /Users/stan/.nvm
189+
PATH(HASHED): c13b21083de9282a02893eccaf6cce88(HASH)
190+
PIPE_LOGGING: 'true'
191+
PWD: /Users/stan/code/diffenv
192+
SHELL: /bin/bash
193+
SHLVL: '2'
194+
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E89PogHTQB/Listeners
195+
TERM: xterm-color
196+
TMPDIR: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/
197+
USER: stan
198+
VERBOSE_LOGGING: 'true'
199+
VSCODE_GIT_ASKPASS_HANDLE(HASHED): 650140d2525815002eb6e27e3300cf67(HASH)
200+
VSCODE_GIT_ASKPASS_MAIN(HASHED): 6af3c36a10ecc53c09c312b7cfdf594b(HASH)
201+
VSCODE_GIT_ASKPASS_NODE(HASHED): 806450b4398ff983c7937491b19c4ece(HASH)
202+
VSCODE_GIT_COMMAND: commit
203+
VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true'
204+
VSCODE_IPC_HOOK: /Users/stan/Library/Application Support/Code/1.37.1-main.sock
205+
VSCODE_IPC_HOOK_EXTHOST: /var/folders/9n/2vf6_x0s79bdzphhpyk83fnr0000gn/T/vscode-ipc-2bd4a4fc-de2f-4707-94a8-b20d768ba681.sock
206+
VSCODE_LOGS: /Users/stan/Library/Application Support/Code/logs/20190816T132442
207+
VSCODE_LOG_STACK: 'false'
208+
VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}'
209+
VSCODE_NODE_CACHED_DATA_DIR: /Users/stan/Library/Application Support/Code/CachedData/f06011ac164ae4dc8e753a3fe7f9549844d15e35
210+
VSCODE_PID: '18791'
211+
VSCODE_PREVENT_FOREIGN_INSPECT: 'true'
212+
XPC_FLAGS: '0x0'
213+
XPC_SERVICE_NAME: '0'
214+
_: /usr/local/bin/diffenv
215+
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0
216+
__PYVENV_LAUNCHER__: /usr/local/bin/python3
217+
218+
shell-version: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright
219+
(C) 2007 Free Software Foundation, Inc.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ __pycache__/
33
*.py[cod]
44
*$py.class
55

6-
.diffenv/commits
76

87
# C extensions
98
*.so

bin/diffenv

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,32 @@ try:
122122
sys.stderr.write("ERROR: Not in a git repot, so cannot add git hooks.")
123123
exit(1)
124124

125-
126125
hooks_dst = os.path.join(
127-
main.git_toplevel, '.git', 'hooks', 'post-commit')
128-
hooks_src = os.path.join(main.get_main_dir(), 'hooks', 'post-commit')
129-
# Copy the hook
130-
copyfile(hooks_src, hooks_dst)
131-
# Make executable
132-
copystat(hooks_src, hooks_dst)
133-
print("virtualenv: Installed git post-commit hook to %s" % hooks_dst)
126+
main.git_toplevel, '.git', 'hooks', 'pre-commit')
127+
if os.path.isfile(hooks_dst):
128+
sys.stderr.write(
129+
"%s already exists. Skipping.\n" % (hooks_dst))
130+
else:
131+
hooks_src = os.path.join(main.get_main_dir(), 'hooks', 'pre-commit')
132+
# Copy the hook
133+
copyfile(hooks_src, hooks_dst)
134+
# Make executable
135+
copystat(hooks_src, hooks_dst)
136+
print("virtualenv: Installed git post-commit hook to %s" % hooks_dst)
134137

135138
hooks_dst = os.path.join(
136139
main.git_toplevel, '.git', 'hooks', 'prepare-commit-msg')
137-
hooks_src = os.path.join(
138-
main.get_main_dir(), 'hooks', 'prepare-commit-msg')
139-
140-
# Copy the hook
141-
copyfile(hooks_src, hooks_dst)
142-
# Make executable
143-
copystat(hooks_src, hooks_dst)
144-
print("virtualenv: Installed git prepare-commit-msg hook to %s" % hooks_dst)
140+
if os.path.isfile(hooks_dst):
141+
sys.stderr.write(
142+
"%s already exists. Skipping.\n" % (hooks_dst))
143+
else:
144+
hooks_src = os.path.join(
145+
main.get_main_dir(), 'hooks', 'prepare-commit-msg')
146+
# Copy the hook
147+
copyfile(hooks_src, hooks_dst)
148+
# Make executable
149+
copystat(hooks_src, hooks_dst)
150+
print("virtualenv: Installed git prepare-commit-msg hook to %s" % hooks_dst)
145151

146152

147153
elif args.compare is not None:
@@ -194,6 +200,11 @@ try:
194200

195201
elif args.issue:
196202
# --share : Get a shareable link
203+
if main.git_toplevel is None:
204+
sys.stderr.write(
205+
"ERROR: Not in a git repot, so cannot add git hooks.")
206+
exit(1)
207+
197208
sys.stderr.write("Collecting env...\r")
198209
env = main.collect_env(facets, whitelist)
199210
yaml_stream = StringIO()

diffenv/hooks/post-commit

Lines changed: 0 additions & 41 deletions
This file was deleted.

diffenv/hooks/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
filename=$(git rev-parse HEAD)
4+
5+
diffenv --output ".diffenv/commits/$filename.yaml"
6+
git add ".diffenv/commits/$filename.yaml"

diffenv/hooks/prepare-commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ COMMIT_MSG_FILE=$1
1111
COMMIT_SOURCE=$2
1212
SHA1=$3
1313

14-
diffenv >> "$COMMIT_MSG_FILE"
14+
echo "\ndiffenv was added to this commit.\n" >> "$COMMIT_MSG_FILE"
1515

examples/config-small.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
facets:
22
diffenv-version:
3+
php:

0 commit comments

Comments
 (0)