git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Andrew Schein <andrew@andrewschein.com>
Cc: git@vger.kernel.org
Subject: Re: git default behavior seems odd from a Unix command line point of view
Date: Tue, 12 May 2009 12:24:45 -0400	[thread overview]
Message-ID: <20090512162444.GC29566@coredump.intra.peff.net> (raw)
In-Reply-To: <4e963a650905120818m70b75892gb4e052187910b9a5@mail.gmail.com>

On Tue, May 12, 2009 at 11:18:25AM -0400, Andrew Schein wrote:

> The [1] in my prompt indicates the exit code of the git commands. What
> I find odd is that even with the -q option, you get this verbose
> output.  Also, you get  a non-zero exit status (which I would expect
> only on a failure such as presence of an unresolved conflict).  My git
> usage is to have a number of small repositories and use a shell script
> to loop over them and perform a sync with a centralized server.
> Having all this wordy output on a "no sync necessary" scenario seems
> counter the desired properties of output only when work is taking
> place or when an error occurs.
> 
> Have others developed git practices to sync a bunch or repositories
> without all this verbose output on a "no change" scenario?

Yes, I have such a script. I check:

  git ls-files -m -o -d --exclude-standard --directory --no-empty-directory

If it produces any output, then there is something to commit (either a
change in a tracked file, or an untracked file that might need to be
added).

I also do a fetch and check to see if we have any commits that need to
be merged:

  git rev-list master..origin

or any commits that we need to push:

  git rev-list origin..master

(actually, it is a bit more complicated, since "master" and "origin" are
just convention; I actually parse the config to find the branch pairs).

-Peff

      parent reply	other threads:[~2009-05-12 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 15:18 git default behavior seems odd from a Unix command line point of view Andrew Schein
2009-05-12 16:12 ` Junio C Hamano
2009-05-12 16:24   ` Andrew Schein
2009-05-12 16:34     ` Jeff King
2009-05-12 18:26     ` Daniel Barkalow
2009-05-12 20:05       ` Andrew Schein
2009-05-12 20:50         ` Daniel Barkalow
2009-05-12 16:24 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090512162444.GC29566@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=andrew@andrewschein.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).