Created
July 6, 2021 19:10
-
-
Save patmaddox/61ddf773f7b65bd2b42cee7f4e5e574d to your computer and use it in GitHub Desktop.
a script to show which untracked files will get annexed and which will be tracked by git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
largefiles = `git annex config --get annex.largefiles` | |
untracked_files = `git ls-files --others --exclude-standard` | |
annex_files = [] | |
git_files = [] | |
untracked_files.split("\n").each do |file| | |
`git annex matchexpression "#{largefiles}" --largefiles --file "#{file}"` | |
if $?.exitstatus == 0 | |
annex_files << file | |
else | |
git_files << file | |
end | |
end | |
puts "files to annex:" | |
annex_files.each {|f| puts "\t- #{f}"} | |
puts | |
puts "files to git:" | |
git_files.each {|f| puts "\t- #{f}"} | |
puts | |
puts "annex.largefiles:" | |
puts "\t#{largefiles}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment