I've started using version control to better manage revisions to my PowerShell code. I decided to use Mercurial for 3 main reasons:
Mercurial works well for versioning PowerShell Modules since each module is contained in its own directory. However, I have some scripts that don't belong in a module, but I would still like to version them. These scripts are in a ".\Scripts" directory that is added to $env:PATH
so I can easily run them from the command line. Since these scripts aren't really related to each other, it doesn't make much sense to create a single repository for the Scripts directory.
How should I version single scripts?
I've thought of the following options:
Is there a tool that better handles versioning single files? Is there better way for versioning single files with Mercurial? Any other ideas?
Version control should be used where more than one version of a document exists, or where this is likely to be the case in the future. finalised version is complete. This would be titled version 1.0. If version 1.0 is to be revised, drafts would be numbered as 1.1, 1.2, etc.
Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team. Thus, temporary or partial edits by one person do not interfere with another person's work.
Centralized Version Control Systems: Centralized version control systems contain just one repository globally and every user need to commit for reflecting one's changes in the repository.
Grouping of files based on their functionality should be based on
1) Name.
2) Folder they are in.
Just give a proper name for the scripts. If there are multiple related scripts group them into a folder. Having one script per folder makes no sense. You end up with almost same number of folders as scripts.
All this in a single repository. Generally, people have multiple projects in a single repo. Creating multiple repos, especially for a few files means lots of overhead. If the script is not "stable" use branches. That is what they are for and merge them back.
And don't worry how many "changesets" are there in the repo!
PS: Might seem a bit opinionated, but there is no real right or wrong answer for what you ask.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With