mirror of
https://github.com/initialcommit-com/git-sim.git
synced 2026-04-26 19:15:51 +03:00
[GH-ISSUE #4] Feature Request: Do not store media in local project directory #5
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/git-sim#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @deadlydog on GitHub (Jan 23, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/4
First off, this is a very cool project. Thank you for it!
One thing I don't like is that git-sim stores it's media files in the local project directory, and it's easy to accidentally commit them to the git repo if it hasn't been added to the .gitignore file. Most of the time I think the images/videos are only needed temporarily, and could be deleted. There is the
--media-dirparameter, but having to provide it every time you use git-sim is cumbersome.There's a few different ways you could tackle this problem. Some thoughts I had were:
Maybe you (or others) have other suggestions?
@initialcommit-io commented on GitHub (Jan 23, 2023):
Hey there,
Thanks for checking out the project, and great points! I did consider this but for the initial release didn't have the time to implement something besides the
--media-diroption you mentioned. It's true that dirtying up the local repo by default isn't really a great practice...I think for starters a configurable global media directory is a good option. This could be stored and read from a user-level or global-level configuration file similar to how Git's config works.
The only real question in my mind is whether media generated from different repos should all go into the same folder, or whether there should be separate subfolders within the global media folder on a per project basis. Probably the latter would make more sense...
Any interest in helping to implement something like this? Happy to give you the lay of the land of the Python codebase if it's something you're interested in poking at! And you would get the honor of being the first contributor! (Whatever that's worth :D)
@abhijitnathwani commented on GitHub (Jan 23, 2023):
Hey @initialcommit-io
If the OP is not available to work on this, I'd like to give it a try and implement this. I agree with your suggestion for a global media dir followed by repo sub folders. Maybe the user can set an environment variable for the same ?
@initialcommit-io commented on GitHub (Jan 23, 2023):
Hey there!
Sure honestly there's no queue so if you want to try implementing something feel free to do so, test it locally, and submit a pull request for me to check it out.
Environment variable would be a cool addition too!
@PaulisMatrix commented on GitHub (Jan 23, 2023):
Hey @initialcommit-io , would def like to work on this. Can you please add a contributions.md to let us know how to contribute/get this setup locally if possible? I think that would be of great help. Thank you!.
@initialcommit-io commented on GitHub (Jan 23, 2023):
Oh yes @PaulisMatrix good idea, will do that shortly!
@abhijitnathwani commented on GitHub (Jan 24, 2023):
Hey @initialcommit-io
To approach the solution I was thinking of the following:
git-sim_mediadirectory would be created in the repo. We could ease out the confusion for tracked files by adding this folder to the.gitignoreso that the user doesn't accidentally add it to their repository.Let me know your thoughts
@Susensio commented on GitHub (Jan 24, 2023):
A workaround I use is to define an alias that calls
git-sim --media-dir="/tmp/git-sim$(git rev-parse --show-toplevel)"@initialcommit-io commented on GitHub (Jan 25, 2023):
@abhijitnathwani I like that solution. It is less complex than having to worry about setting up config files at different scopes, like repo scope / user scope / system scope. I think it's a reasonable assumption for now that users who want to customize this location would be ok with a single global folder which would contain subfolders for each repo like you mentioned. That would also keep them nicely organized in one place, and I think is a good use case for an environment variable.
Just 2 things:
Let's make sure to test/validate that the environment variable method works on Windows/Linux/MacOS
In your third point you mentioned potentially adding an entry automatically into .gitignore, which we could do, but then the user might be confused as to why the .gitignore is suddenly modified in the repo. I think it's better to just add the
git-sim_mediafolder and they can handle it how they want.Let me know if that sounds ok!
@initialcommit-io commented on GitHub (Jan 25, 2023):
@PaulisMatrix FYI I just added
CONTRIBUTING.mdwith details on how to contribute and run the source code locally.@deadlydog commented on GitHub (Jan 26, 2023):
Thanks so much for making this happen! 🙌