Skip to main content

Scan Version Control For Uncommitted Changes

Project description

When working on one version-controlled project on my hard drive, I often flip over quickly to another project to make a quick change. By the end of the day I have forgotten about that other change and often find it months later when I enter that repository again. I needed a way to be alerted at the end of each day about any uncommitted changes sitting around on my system.

Thus was born this “uncommitted” script: using either your system locate(1) command or by walking a filesystem tree on its own, it will find version controlled directories and print a report on the standard output about any uncommitted changes still sitting on your drive. By running it from a cron(8) job you can make this notification routine.

Running “uncommitted”

By default “uncommitted” uses the locate(1) command to scan for repositories, which means that it can operate quickly even over very large filesystems like my home directory:

$ uncommitted ~

But you should be warned: because the locate(1) database is only updated once a day on most systems, this will miss repositories which you have created since its last run. To be absolutely sure to see all current repositories, you should instead ask “uncommitted” to search the filesystem tree itself. To do this on your “devel” directory, for example, you would type this:

$ uncommitted -w ~/devel

Not only will the output of “-w” always be up-to-date, but it is usually faster for small directory trees. The default behavior (which can also be explicitly requested, with “-l”) is faster when the directory tree you are searching is very large.

Should you ever want a list of all repositories, and not just those with uncommitted changes, you can use the “-v” verbose option:

$ uncommitted -v ~

You can always get help by running “uncommitted” without arguments or with the “-h” or “–help” options.

Supported VCs

At the moment, “uncommitted” supports:

It needs to support Git soon, since that DVCS is in widespread use. However, I am not familiar enough with Git’s output to write a function for it myself. When I tried out Git a few minutes ago, its status messages were crazy, with all sorts of hash characters everywhere; it looked like it was suffering from an acute lack of confidence, and was therefore commenting out all of its own output. Anyway, there is probably some simple way to make Git report on uncommitted changes, but I will leave it to a Git fan to figure out how, if they would like to contribute a patch back.

I would also not be opposed to someone contributing a Bazaar plugin. But CVS should probably never be supported by “uncommitted” because that might imply that it is still an acceptible system to be using.

It occurs to me that there might already be some version control abstraction layer that I should be using for this, rather than figuring out how to run each version control system myself; a quick search of PyPI suggests that I take a closer look at the pyvcs project. Maybe that can be a useful direction for the next phase of development!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uncommitted-1.0.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file uncommitted-1.0.tar.gz.

File metadata

  • Download URL: uncommitted-1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uncommitted-1.0.tar.gz
Algorithm Hash digest
SHA256 e1b013a413e6688071fb83ed398fae667952f89c0a48a234cb04f039b728ee9d
MD5 e461edbce7ccf1a6be78cd55fb8fdca3
BLAKE2b-256 a54764e8a8fb6e698a4a29fbf108fad9e3a202068f1082c3042e7291cd4e5154

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page