joe icon indicating copy to clipboard operation
joe copied to clipboard

Consider adding custom gitignore files too

Open karan opened this issue 10 years ago • 14 comments

Maybe platform specific?

Mac needs to have .DS_Store for example. Some cloud platforms have their own files that need to be ignored. Editors have some (like #3).

How should be structure this?

I'm thinking this:

joe/
---- data/
-------- gitignore/    # submodule from github/gitignore
-------- custom/      # our own custom files

Seems good? Anyone have a good list of such files we can add?

karan avatar Jan 13 '15 02:01 karan

#10 Doesn't organize the directory. Will rearrange that momentarily. I would appreciate any feedback on the new code to handle fetching the .gitignore file.

munrocape avatar Jan 13 '15 03:01 munrocape

Looking at the PRs for github/gitignore, it looks quite active as well as has a high quality barrier. It may be best to let them have to deal with vetting *.gitignore files as they require proof in the PR.

I think it would be easier to remove the current submodule and re-add it with the new directory path as opposed to moving the current submodule.

munrocape avatar Jan 13 '15 03:01 munrocape

Yup that sounds like a good plan. Let's do that after #10 is merged.

Left some notes on the PR.

karan avatar Jan 13 '15 17:01 karan

The directory structure looks good.

Perhaps two new commands should be added - add and remove. joe add <name> (<path> | [TEXT...]) joe remove <name>

These will copy and subsequently remove a .gitignore file. Name cannot exist already in the data/ folder and you can only remove custom gitignore's. <path> is the path to the a .gitignore file. Perhaps alternatively a user could just list off what they want ignored and do not have to create an intermediate file.

munrocape avatar Jan 16 '15 13:01 munrocape

I like that idea. I'm worried about custom data and updates. If we use the now-used data/ folder, then any time the user updates joe, all data will be wiped. We might need to add platform-specific code for this.

Linux data goes in /usr/share, Win in \ProgramData, Mac OS X in /Library/Application Support.

karan avatar Jan 19 '15 16:01 karan

How about a folder just for custom data. When you run joe something it looks in the custom folder first. If not found, look in the defaults ignores and fails otherwise. This way we could "overwrite" the default definitions and nothing would be affected during updates...

filipekiss avatar Jan 20 '15 19:01 filipekiss

@filipekiss I think the issue is when updating via a package manager this folder would be overridden. As a result, it would need to be stored anywhere but joe/ as it would be deleted upon update.

I may be wrong, though.

munrocape avatar Jan 20 '15 19:01 munrocape

@munrocape I'm not sure about Windows, but for Linux and OS X maybe create a $HOME/.joe folder where custom data and settings would be stored. This way package managers would not override stuff when updating Joe itself.

filipekiss avatar Jan 20 '15 20:01 filipekiss

That's what @karan listed - the customary/predictable locations for each OS where data like this can be stored.

I'll publish a branch later tonight regarding this if you want to check it out.

Sent from my iPhone

On Jan 20, 2015, at 4:00 PM, Filipe [email protected] wrote:

@munrocape I'm not sure about Windows, but for Linux and OS X maybe create a $HOME/.joe folder where custom data and settings would be stored. This way package managers would not override stuff when updating Joe itself.

— Reply to this email directly or view it on GitHub.

munrocape avatar Jan 20 '15 20:01 munrocape

Great! I'll take a look, for sure. :D

— Enviado de um iCoiso

On Tue, Jan 20, 2015 at 6:10 PM, Zach Munro-Cape [email protected] wrote:

That's what @karan listed - the customary/predictable locations for each OS where data like this can be stored. I'll publish a branch later tonight regarding this if you want to check it out. Sent from my iPhone

On Jan 20, 2015, at 4:00 PM, Filipe [email protected] wrote:

@munrocape I'm not sure about Windows, but for Linux and OS X maybe create a $HOME/.joe folder where custom data and settings would be stored. This way package managers would not override stuff when updating Joe itself.

— Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub: https://github.com/karan/joe/issues/9#issuecomment-70723637

filipekiss avatar Jan 20 '15 20:01 filipekiss

Seems like @filipekiss worked on it. Will wait for a PR.

karan avatar Jan 22 '15 16:01 karan

Yeah, @filipekiss saw it through to completion :shipit:

Sent from my iPhone

On Jan 22, 2015, at 12:03 PM, Karan Goel [email protected] wrote:

Seems like @filipekiss worked on it. Will wait for a PR.

— Reply to this email directly or view it on GitHub.

munrocape avatar Jan 22 '15 16:01 munrocape

New idea.

We move all files to a platform-specific folder: something like ~/.share/joe or something like that. We can have the gitignore repo there, and custom files.

karan avatar Jan 23 '15 16:01 karan

What do you think about ~/.joe/data/default and ~/.joe/data/custom to store the data we'll be using and, if we ever need, we can also add ~/.joe/settings there. This way will keep everything related to joe namespaced and won't risk messing some other app files.

filipekiss avatar Jan 23 '15 16:01 filipekiss