stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Rename web-user.sh to web-user-example.sh

Open cryptotester opened this issue 1 year ago • 7 comments

Describe what this pull request is trying to achieve.

Rename web-user.sh to web-user-example.sh

This is needed, because if users apply changes, when they issue a git pull there may be conflicts. Also, the web-user.sh is ignored in .gitignore, so this file should have never been checked in the first place (but rather, as in many other projects) provided with a different name (e.g. example, template etc. I used example).

Environment this was tested in

List the environment you have developed / tested this on. As per the contributing page, changes should be able to work on Windows out of the box.

  • OS: Linux
  • Browser: N/A
  • Graphics card: N/A

cryptotester avatar Jan 30 '23 21:01 cryptotester

This should also take Windows users into account, and rename the webui-user.bat similarly.

You can also always just git stash && git pull && git stash pop.

Vilsepi avatar Jan 31 '23 05:01 Vilsepi

This should also take Windows users into account, and rename the webui-user.bat similarly.

You can also always just git stash && git pull && git stash pop.

Thanks for the reply. Yes, so far I always had to restore my sh file, then git pull, then apply the stash again, I just didn't like it ;) (it's more user friendly to just git pull and have the ignored files properly ignored by .gitignore).

I did another commit for the bat file for Windows, as you recommended.

Hope the PR is ok now. If you need my change to the readme to be modified, feel free to change it or let me know how to amend it, and I'll do another commit for the PR to be accepted (I hope).

Thanks and cheers

cryptotester avatar Jan 31 '23 07:01 cryptotester

hi @cryptotester, what example problem does this solve?

did you look at this? https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing#quirks

ClashSAN avatar Jan 31 '23 11:01 ClashSAN

hi @cryptotester, what example problem does this solve?

did you look at this? https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing#quirks

It solves this problem:

image If you check the .gitignore file, the web-user.bat and web-user.sh files are listed in it. Just, somebody probably added them to the gitignore file but forgot to remove them from the repo (happened to me in the past too, if the file is not deleted, it will still pop up in the changes if you edit it, even if it's in the .gitignore file)

It's expected by users who want to customize command line args not to edit the main file, but to edit this customizable file. As such it makes sense to have the customizable file ignored in .gitignore.

My PR fixes this: by removing the file from the repo. Instead of completely deleting the files, I rename them as example/template (people who don't need this file can just leave as is.

Users who need to customize the launch options make a copy of the example file to the proper name. Proper name is in the .gitignore, so this doesn't have conflicts if you do git pull and the repo also looks clean (no changes detected) when you do a git status. I know I can stash, then do git pull, then apply the stash, but it's not good practice to leave things like this.

It's like telling users to edit an .env file, usually it's not a good idea to commit the .env file, in fact it's quite industry standard to have a .env.example file and asking users to copy the file to .env to get started.

Same thing here with this script.

TL;DR: web-user.sh and web-user.bat are listed in the .gitignore file, as such they should not be checked in the repo (else, if modified, they interfere and may be also checked in by repo forkers by mistake in future commits/future PRs). My PR fixes this by renaming those files and updating the readme accordingly.

cryptotester avatar Jan 31 '23 13:01 cryptotester

This would add an additional step towards setting up the UI for new users, which is counterproductive to what should be the goal: simplifying the setup experience.

I've seen plenty of users on Discord that encounter an issue solved via editing the user file (eg needing to add no-half or whatever), and when I suggest this to them, they respond with "what's that? how do I edit that?" - which imo is a positive sign, that currently users don't need to have any idea what these script files are or how to work with them to be able to run the WebUI. With this proposed changed, users would be forced to figure that out before they can start using the WebUI.

mcmonkey4eva avatar Feb 09 '23 09:02 mcmonkey4eva

This would add an additional step towards setting up the UI for new users, which is counterproductive to what should be the goal: simplifying the setup experience.

I've seen plenty of users on Discord that encounter an issue solved via editing the user file (eg needing to add no-half or whatever), and when I suggest this to them, they respond with "what's that? how do I edit that?" - which imo is a positive sign, that currently users don't need to have any idea what these script files are or how to work with them to be able to run the WebUI. With this proposed changed, users would be forced to figure that out before they can start using the WebUI.

Additional step, you mean telling users "to customize command line args, please copy web-user-example.sh to web-user.sh and edit it?"

There are these kind of users, for which copying a file is a tremendous extra step (but they were able to download the repo, configure cuda, install python etc...)

and there are also users who just edited the web-user.sh file and do git pull to get the latest changes and maybe they don't know how git stash works etc. those users who cares, right? In the worst case people move the web-user.sh in a different folder, then move it back after git pull...

Good thing, with this issue now I personally master git stash and git stash pop ;)

I just felt sorry for all other git users who don't know these 2 commands and would encounter the same annoyance and wanted to help them with this PR... but I guess... priorities (making a copy of a file seems much more complicated than remembering by heart git stash; git pull; git stash pop I get it.

Then just for principle don't add those files in the .gitignore. Because they are not ignored.

cryptotester avatar Feb 09 '23 11:02 cryptotester

You don't have to git stash, that happened a few times in the past by mistake but it is now a formal rule that the user file is never to be edited in commits, as noted in the link posted by ClashSAN

mcmonkey4eva avatar Feb 10 '23 05:02 mcmonkey4eva