Probably each developer has a working folder with checkouts (svn) and clones (git, hg) of different projects. They call it differently: workspace, work, src, etc.
Does it ever happen that you forget to commit or push changes to working directories? Even if the answer is not often, but it happens, then you should get acquainted with the utility
unpushed . It helps to keep the working folder with projects always in a clean and consistent state.
For example, I have about 20 projects from different repositories in the ~ / workspace folder. For some reason I want to delete this workspace. Before that, you need to check whether everything is locked up. Manual to do it is not very fast. So this script was born.
')
Under the cat a brief overview of the program.
unpushed is a Python program. Install using
pip or
easy_install :
$ sudo pip install unpushed
or
$ pip install --user unpushed
It is used very simply. To list all unfilled and unfilled changes in the working folder ~ / workspace:
$ unpushed ~/workspace
* /home/nailgun/workspace/unpushed uncommitted (Git)
* /home/nailgun/workspace/unpushed:master unpushed (Git)
* /home/nailgun/workspace/python:new-syntax unpushed (Git)
The following VCS are currently supported:
By default, unpushed uses
locate(1)
to search for repositories in the working folder with projects. You can also use simple
find(1)
if locate does not work for you:
$ unpushed -w ~/workspace
You can find out about other command line keys by calling the utility with the
--help
option.
Desktop Notifications
$ unpushed-notify ~/workspace
will cause unpushed and display a notification on the desktop (on Linux via the libnotify library) if there are changes. It is convenient to make a call to this utility on a schedule. To do this, run the crontab editor for your (!) User:
$ crontab -e
and add a line like this:
*/10 18-20 * * * unpushed-notify ~/workspace
After that, your working folder will be scanned every 10 minutes at the end of the working day. If uncommitted changes are detected, a message will be displayed on the desktop.
Restrictions
There are support for non-committed changes for all the listed VCS. Open branches are supported only for Git. It should be very easy to add support for Mercurial, but I have never worked with it and do not know how to do it.
Desktop notifications work only under Linux using the pynotify library, i.e. on all modern distributions.
Disclaimer
This is a fork of the
uncommited project. Added support for unsolicited branches and Desktop notifications. Implemented for myself, only then I thought that maybe it would be useful to someone else. Therefore, the utility is limited mainly to use under Linux for Git.
If anyone has a desire to add support for notifications for other operating systems or support for branches in Hg, you should. I will accept your pull request on
githaba .