Change control in working directories

    Probably every 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 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 unpushed utility . It helps to maintain a working folder with projects always in a clean and consistent state.

    For example, in my ~ / workspace folder there are about 20 projects from different repositories. For some reason I want to delete this workspace. Before this, you need to check whether everything is commanded for sure. Manually doing this is not very fast. And this script was born.

    Under cat short review of the program.

    unpushedIs a Python program. Installed using pip or easy_install :
    $ sudo pip install unpushed
    or
    $ pip install --user unpushed

    Used very simply. To list all uncommitted and non-pushed changes in the ~ / workspace working folder: The following VCS are currently supported:
    $ unpushed ~/workspace
    * /home/nailgun/workspace/unpushed uncommitted (Git)
    * /home/nailgun/workspace/unpushed:master unpushed (Git)
    * /home/nailgun/workspace/python:new-syntax unpushed (Git)


    • Mercurial
    • Git
    • Subversion

    By default, unpushed is used locate(1)to search for repositories in the working folder with projects. You can also use a simple find(1)one if locate does not work for you:
    $ unpushed -w ~/workspace
    You can find out about other command line switches by calling the utility with the option --help.

    Desktop notifications

    $ unpushed-notify ~/workspace
    will call unpushed and show a notification on the desktop (in Linux through 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 such as 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.

    Limitations

    Support for non-committed changes is available for all listed VCS. Unframed branches are supported only for Git. Adding Mercurial support should be very simple, but I have never worked with it and I don’t know how to do it.

    Desktop notifications only work under Linux using the pynotify library, i.e. on all modern distributions.

    Disclaimer

    This is a fork of the uncommited project . Added support for unhandled branches and Desktop notifications. I realized for myself, only then I thought that maybe it would be useful to someone else. Therefore, the utility is mainly limited to use under Linux for Git.

    If anyone has a desire to add notification support for other operating systems or support for branches in Hg - well. I will accept your pull request on github .

    Also popular now: