Skip to content

Instantly share code, notes, and snippets.

@abraithwaite
Created April 9, 2015 04:23
Show Gist options
  • Save abraithwaite/6ed377b56b9fc23c2e13 to your computer and use it in GitHub Desktop.
Save abraithwaite/6ed377b56b9fc23c2e13 to your computer and use it in GitHub Desktop.
Let's Git Racy
abraithwaite@jessie qwer]$ cat asdf.zip
version https://git-lfs.github.com/spec/v1
oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
size 0
[abraithwaite@jessie qwer]$ git status
On branch qwer
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: asdf.zip
no changes added to commit (use "git add" and/or "git commit -a")
[abraithwaite@jessie qwer]$ export GIT_TRACE=1 && /tmp/racy.sh
20:46:45.049927 git.c:349 trace: built-in: git 'checkout' 'master'
20:46:45.050562 run-command.c:341 trace: run_command: 'git lfs clean '\''asdf.zip'\'''
20:46:45.050757 run-command.c:192 trace: exec: '/bin/sh' '-c' 'git lfs clean '\''asdf.zip'\''' 'git lfs clean '\''asdf.zip'\'''
20:46:45.052309 git.c:554 trace: exec: 'git-lfs' 'clean' 'asdf.zip'
20:46:45.052373 run-command.c:341 trace: run_command: 'git-lfs' 'clean' 'asdf.zip'
trace git-lfs: run_command: 'git' version
M asdf.zip
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
abraithwaite@jessie qwer]$ cat asdf.zip
version https://git-lfs.github.com/spec/v1
oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
size 0
[abraithwaite@jessie qwer]$ git checkout .
21:15:52.732496 git.c:349 trace: built-in: git 'checkout' '.'
21:15:52.734881 run-command.c:341 trace: run_command: 'git lfs smudge '\''asdf.zip'\'''
21:15:52.735200 run-command.c:192 trace: exec: '/bin/sh' '-c' 'git lfs smudge '\''asdf.zip'\''' 'git lfs smudge '\''asdf.zip'\'''
21:15:52.736800 git.c:554 trace: exec: 'git-lfs' 'smudge' 'asdf.zip'
21:15:52.736839 run-command.c:341 trace: run_command: 'git-lfs' 'smudge' 'asdf.zip'
trace git-lfs: run_command: 'git' version
[abraithwaite@jessie qwer]$ cat asdf.zip
[abraithwaite@jessie qwer]$
$ cat /tmp/racy.sh
#!/bin/bash
touch asdf.zip # update st_mtime to now
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment