Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Touch tracked files that are already added to git#1104

Merged
sinbad merged 3 commits into
masterfrom
touch-tracked-files
Apr 5, 2016
Merged

Touch tracked files that are already added to git#1104
sinbad merged 3 commits into
masterfrom
touch-tracked-files

Conversation

@sinbad

@sinbad sinbad commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

Resolves #1057

If a file is already tracked in git when it's added to git-lfs tracking, that file is now 'touched' (mtime/atime file attributes updated) to ensure that it appears as modified in git status along with the .gitattributes and therefore prompts the user to re-commit it. Without doing this git doesn't detect that the index is dirty for this file and the user could commit .gitattributes but with the file content remaining as non-LFS, which can cause problems when checking out this commit in future. Checking out this commit will forever after show the file as modified in the working copy because smudge will not have LFS data to checkout from even though .gitattributes says it should have, and clean will show a diff.

sinbad added 2 commits March 22, 2016 10:38
This makes them appear as modified in 'git status' which indicates they
need to be re-committed to be moved into LFS if already in git.
See #1057
@sinbad sinbad added the review label Mar 22, 2016
@technoweenie technoweenie mentioned this pull request Mar 31, 2016
17 tasks
Comment thread git/git.go Outdated
line := scanner.Text()
ret = append(ret, strings.TrimSpace(line))
}
return ret, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should wait for the command to finish before returning.

@technoweenie

Copy link
Copy Markdown
Contributor

Looks great 👍. I updated git.GetTrackedFiles() so it waits for the command to finish.

@sinbad

sinbad commented Apr 5, 2016

Copy link
Copy Markdown
Contributor Author

I updated git.GetTrackedFiles() so it waits for the command to finish.

Doh, thanks for catching that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants