Re: Git commands

2010-07-24 Thread Matej Urban
Hello,

On Fri, Jul 23, 2010 at 9:54 PM, Wouter Bolsterlee wbols...@gnome.org wrote:
 Op woensdag 21-07-2010 om 21:40 uur [tijdzone +0200], schreef Matej
 Urban:
 is it possible to grep the git commands? OR HOW do I output only the
 last line of git command.

 I want git pull to only output the last line usually something like
 - X files changed, XXX insertions(+), XXX deletions(-)
 - Already up-to-date.

 or when using git push only
 - 45604564 master - master
 ...

 I tried various variations of git pull | tail -1

 Perhaps git writes to stderr instead? Try this:

  $ git pull 21 | tail -n1

 ...instead.

I have no idea what 21 stands for, but it works!
I successfully combined it with egrep to do the job.

Really big thanks!
M!



    — Wouter

___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Git commands

2010-07-24 Thread Christopher Roy Bratusek
21 means to both redirect stderr (2) and stdin (1)
for more infos check your shell's manpage (eg man bash)

 I have no idea what 21 stands for, but it works!
 I successfully combined it with egrep to do the job.

Regards
Chris
___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Git commands

2010-07-24 Thread Wouter Bolsterlee
Op zaterdag 24-07-2010 om 20:54 uur [tijdzone +0200], schreef Matej
Urban:
 On Fri, Jul 23, 2010 at 9:54 PM, Wouter Bolsterlee wbols...@gnome.org wrote:
  Perhaps git writes to stderr instead? Try this:
 
   $ git pull 21 | tail -n1
 
  ...instead.
 
 I have no idea what 21 stands for, but it works!
 I successfully combined it with egrep to do the job.

21 means that the stderr (file descriptor 2) gets redirected () to
stdout (file descriptor 1), so that subsequent programs (e.g. grep)
actually see the input when your shell pipes git's stdout into grep's
stdin.

 Really big thanks!

You're welcome.

— Wouter


signature.asc
Description: This is a digitally signed message part
___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n