{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/brew/issues/145","repository_url":"https://api.github.com/repos/Homebrew/brew","labels_url":"https://api.github.com/repos/Homebrew/brew/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/145/comments","events_url":"https://api.github.com/repos/Homebrew/brew/issues/145/events","html_url":"https://github.com/Homebrew/brew/issues/145","id":151004819,"number":145,"title":"[Analytics] Do not drop .homebrew_analytics_user_uuid in HOME","user":{"login":"zmwangx","id":4149852,"avatar_url":"https://avatars.githubusercontent.com/u/4149852?v=3","gravatar_id":"","url":"https://api.github.com/users/zmwangx","html_url":"https://github.com/zmwangx","followers_url":"https://api.github.com/users/zmwangx/followers","following_url":"https://api.github.com/users/zmwangx/following{/other_user}","gists_url":"https://api.github.com/users/zmwangx/gists{/gist_id}","starred_url":"https://api.github.com/users/zmwangx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmwangx/subscriptions","organizations_url":"https://api.github.com/users/zmwangx/orgs","repos_url":"https://api.github.com/users/zmwangx/repos","events_url":"https://api.github.com/users/zmwangx/events{/privacy}","received_events_url":"https://api.github.com/users/zmwangx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-04-25T23:19:42Z","updated_at":"2016-04-26T18:37:59Z","closed_at":null,"body":"[`analytics.sh`](https://github.com/Homebrew/brew/blob/1451553188276117a574b2abe8957cb60ef7ced7/Library/Homebrew/utils/analytics.sh#L6) currently hard-codes `HOMEBREW_ANALYTICS_USER_UUID_FILE` to `$HOME/.homebrew_analytics_user_uuid`, but many of us don't want to have additional dotfiles cluttering our home directory.\r\n\r\nThere are several alternatives I can think of:\r\n\r\n1. Follow [XDG Base Dir Spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). Put the file in `${XDG_DATA_HOME:-$HOME/.local/share}/homebrew`, i.e.,\r\n\r\n    ```bash\r\n    HOMEBREW_ANALYTICS_USER_UUID_FILE=${XDG_DATA_HOME:-$HOME/.local/share}/homebrew/analytics_user_uuid\r\n    ```\r\n\r\n    (The patch won't be as simple as replacing a line; one still needs to `mkdir -p -m`.)\r\n\r\n2. Make XDG Base Dir Spec an opt-in (only loosely follow it), i.e., use `XDG_DATA_HOME` if it's set and non-nil:\r\n\r\n    ```bash\r\n    if [[ -n $XDG_DATA_HOME ]]; then\r\n        HOMEBREW_ANALYTICS_USER_UUID_FILE=$XDG_DATA_HOME/analytics_user_uuid\r\n    else\r\n        HOMEBREW_ANALYTICS_USER_UUID_FILE=$HOME/.homebrew_analytics_user_uuid\r\n    fi\r\n   ```\r\n\r\n3. Use `$HOME/Library/Application Support/Homebrew` or `/Library/Application Support/Homebrew`, like standard OS X applications. Homebrew is not an \"application\" in the app bundle sense, but since we already use `/Library/Caches/Homebrew` it won't be too strange. Whether to use user `Library` or system `Library` is debatable; technically speaking Homebrew is system-wide by default, but it mostly targets \"single-user\" systems, and users may choose to install to home directory, so `$HOME/Library` is probably better.\r\n\r\n4. Of course there's also the traditional one-more-env-var approach. I'm personally not a fan of it.\r\n\r\nWhat are your opinions?"},"comment":{"url":"https://api.github.com/repos/Homebrew/brew/issues/comments/214843457","html_url":"https://github.com/Homebrew/brew/issues/145#issuecomment-214843457","issue_url":"https://api.github.com/repos/Homebrew/brew/issues/145","id":214843457,"user":{"login":"zmwangx","id":4149852,"avatar_url":"https://avatars.githubusercontent.com/u/4149852?v=3","gravatar_id":"","url":"https://api.github.com/users/zmwangx","html_url":"https://github.com/zmwangx","followers_url":"https://api.github.com/users/zmwangx/followers","following_url":"https://api.github.com/users/zmwangx/following{/other_user}","gists_url":"https://api.github.com/users/zmwangx/gists{/gist_id}","starred_url":"https://api.github.com/users/zmwangx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmwangx/subscriptions","organizations_url":"https://api.github.com/users/zmwangx/orgs","repos_url":"https://api.github.com/users/zmwangx/repos","events_url":"https://api.github.com/users/zmwangx/events{/privacy}","received_events_url":"https://api.github.com/users/zmwangx/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T18:37:59Z","updated_at":"2016-04-26T18:37:59Z","body":"Now that I think about it, since we already have `homebrew.analyticsdisabled` in `$HOMEBREW_PREFIX/.git/config`, can we also add `homebrew.analyticsuuid` and get rid of a separate UUID file entirely?"}}