Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ignore custom Finder folder icons (but leave disabled by default) #364

Closed
wants to merge 4 commits into from

3 participants

@Calrion

Added a rule to ignore custom folder icons, but leaving disabled by default as some may want custom icons tracked.

The non-printable characters in the entry are carriage returns (U+000D); including them—and two of them—literally is the only way I've found of actually getting the intended behaviour. Escaping the characters like \015 or \x0D doesn't seem to work for this case.

See also existing discussion.

@Calrion Calrion Added custom Finder folder icons, disabled by default.
Added a rule to ignore custom folder icons, but leaving disabled by default as some may want custom icons tracked.
da9d83f
@x3ro

I would really use a few more explanatory lines here, that is, at least mention that the entry contains invisible characters and a link to this pull request for further explanation, maybe even to the blogpost you've mentioned. This way we will hopefully avoid more time being spent on this weird "thing" (yes, I'm looking at you, apple)...

Good idea. But there's a bigger problem: when I opened the file to add additional comments, I noticed that Git had (helpfully) stripped out the binary characters. Requires more research, I think.

Are you sure that the characters were stripped by git? It would surprise me, given that git usually doesn't touch the content of a commit. Also, I downloaded a raw copy from the .gitignore file from your repository, and it worked just fine (that is, the characters were present and the file was being ignored). I'd guess that your editor stripped the characters, because it wrongly identified them as windows linebreaks which it converted to unix style linebreaks...

No, I'm not sure; on closer inspection the characters were present and correct, it was only that TextMate wasn't displaying things as I expected.

Calrion added some commits
@Calrion Calrion Fixed incorrect Icon record… with a todo.
Ignoring Finder folder icons requires more work. It seems that Git is filtering the binary characters on commit.
90f8024
@Calrion Calrion Gah, forgot the link! 3313c4f
@Calrion Calrion Re-added entry for custom icons.
Seems it was TextMate not displaying the characters as expected. Vi still shows ^M^M at the end of the entry.
d5c3075
@Calrion

Ok, I've added more info (including a link to that blog post) as suggested above. Slight confusion as TextMate wasn't showing the characters in the same way when subsequently opening the file (nor was Tower, nor the GitHub site!). Huge kudos to Apple for selecting a most excellently exquisite filename!

@x3ro

Just found #334 by @mkenyon which is identical to this PR. However, it too lacks some explanation within the .gitignore file, so I'd like this request to be properly updated and then merged, if possible.

@Calrion

Agreed. Does d5c3075 (now part of this pull) give enough detail, do you think?

@jspahrsummers

#334 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 6, 2012
  1. @Calrion

    Added custom Finder folder icons, disabled by default.

    Calrion authored
    Added a rule to ignore custom folder icons, but leaving disabled by default as some may want custom icons tracked.
  2. @Calrion

    Fixed incorrect Icon record… with a todo.

    Calrion authored
    Ignoring Finder folder icons requires more work. It seems that Git is filtering the binary characters on commit.
  3. @Calrion

    Gah, forgot the link!

    Calrion authored
  4. @Calrion

    Re-added entry for custom icons.

    Calrion authored
    Seems it was TextMate not displaying the characters as expected. Vi still shows ^M^M at the end of the entry.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 Global/OSX.gitignore
View
9 Global/OSX.gitignore
@@ -1,5 +1,14 @@
.DS_Store
+# Custom Finder folder icons can be ignored
+# by adding a record for `Icon` followed by
+# two literal CR characters. Escaping seems
+# not to work in this case.
+# See http://blog.bitfluent.com/post/173740409/ignoring-icon-in-gitignore
+# for more info.
+# Uncomment the line below to enable.
+#Icon
+
# Thumbnails
._*
Something went wrong with that request. Please try again.