0

TLDR; I just want to keep .css files hidden but updated whenever I commit .less files.

I want to hide a bunch of .css files on smartgit, because they are generated from .less files. Most would suggest .gitignore, but I still need them tracked (for deployment reasons). Lessc is run by IDE.

I also tried assume-unchanged, but then they are just not committed in.

I also tried pre-commit hook, to automatically add these .css files, but they are left visible as staged wt as head

My last try in pre-commit was

touch
--no-assume-unchanged
add
--assume-unchanged

but while the .css is committed and finally pushed, Smartgit ends up showing them as staged unchanged (assumed but modified) (or something like that).

diynevala
  • 503
  • 1
  • 4
  • 19
  • 1
    I think the general consesus is that as a rule of thumb, you should not store generated files in your repo. https://homes.cs.washington.edu/~mernst/advice/version-control.html#Dont_commit_generated_files https://stackoverflow.com/q/893913/151344 https://softwareengineering.stackexchange.com/q/192113 Typically, you should generate those files as a part of the build process. Process would then be: `store version in git` -> `build & generate files` -> `deploy the result of the build` (downvote is not mine though). – Alderath Nov 09 '18 at 08:23
  • @Alderath Yes, I agree with that process. Unfortunately, I don't get to dictate how stuff is deployed at work, so this is the situation. Files are pulled at the deployment server and .css files are used as they come. I am surprised that git has no way of implementing such and/or people just downvote without any feedback. – diynevala Nov 09 '18 at 10:18
  • 1
    To me it's no surprise that neither Git not SmartGit support such a setup. Your request is contradictory: on one hand you want to have your files being versioned controlled and committed, on the other hand you want to hide them from version control. I'm pretty sure that implementing such functionality (i.e. silently adding files to a commit) would open doors to many tricky user errors. – mstrap Nov 09 '18 at 15:23
  • @mstrap I agree on everything you said, but as there are so many ways to go around commits and pushes, I am surprised that this one is not possible - well not easily anyway. "Tricky user errors" should not be the deciding factor, as building such configuration around the repository would require me to actively choose to make such functionality. – diynevala Nov 14 '18 at 13:06

1 Answers1

1

In smartgit you could use its integrated filter box with the regex !*.css. The counter part if that it will show you ALL files that match the pattern, shadowed if unchanged.

I didn't found a way stack the result of that filter box with the traditional filters.

LuisGP
  • 431
  • 3
  • 13
  • Good point, but does not resolve my pain. I seek to remove everything "not essential" from the git UI, to avoid routinely clicking style.css commit every time. – diynevala Nov 14 '18 at 13:08