All,

I've been using ``mr`` to track my various projects in git,
along with my home directory.  I really like how it allows me to
organize and track my work.  For some time, I've been using a
home-grown utility to quiet down the output from ``mr status``.
In this way, I can run ``mr status`` from my home directory and
check the status of all 130+ repositories at once without having
to scroll back through twice that many lines of text looking for
something interesting.

The output from ``mr status`` by default looks something like
the following::

  mr status: /home/mike/.

  mr status: /home/mike/.vim
   M vimrc

  mr status: /home/mike/projects/ProjectOne

  mr status: /home/mike/projects/ProjectTwo

  [...]

  mr status: /home/mike/projects/ProjectN

I could grep away the blank lines and the ``mr status:...``
lines, but this makes it difficult in general to tell which
repository contains the changes.  I prefer to keep the ``mr
status:...`` lines for repositories with changes, but squelch
them otherwise.  In the above example, my preferred output
would be:

  mr status: /home/mike/.vim
   M vimrc

In case someone else might find it useful, I've published this
Python-based utility (which I've named ``ptee`` for "Progress
Tee") on the Python Package Index.  I alias ``mr`` to point to
the below script (which I call ``mrwrap``) so that I can execute
``mr status`` and get the quiet output I prefer.

To try this out::

  pip install ptee
  alias mr='mrwrap'

Then save the text between the ``---cut`` lines as ``mrwrap``
and make it executable.  The ``ptee`` utility can be found here
for manual downloading:
https://pypi.python.org/pypi?name=ptee&version=0.2.0&:action=display

---cut mrwrap---
#!/bin/bash

mrtee()
{
    ptee \
        --regex '^mr (status|update|push): /' \
        --regex '^(Everything|Already) up-to-date' \
        --regex '^\s*$' \
        --heading-regex '^mr \S+: finished '
}

mr "$@" 2>&1 | mrtee
---cut mrwrap---

Michael Henry

_______________________________________________
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home

Reply via email to