Re: git-log to go forward instead of reverse?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "Junio" == Junio C Hamano <junkio@xxxxxxx> writes:

>> ## (code here to cd to the right dir omitted)
>> git-fetch
>> if git-status | grep -v 'nothing to commit'

Junio> git-status exits non-zero for "nothing to commit" case, so do
Junio> not grep its output, but check the status of the command, to see
Junio> if your tree is in a good shape to do a pull.

No, this is deliberate.  I want to see nothing if we're up to date, but if
not, I want to see *everything else* that git-status said.  This nice "grep
-v" does precisely the right thing.

Junio> Do we not leave ORIG_HEAD when we are already up-to-date?  If so
Junio> that would be confusing...  No, we do leave ORIG_HEAD no matter
Junio> what, so you do not have to have this inner if to grep
Junio> up-to-date (on the other hand, you might want to do intelligent
Junio> things when git-pull fails).  So just drop the if and say
Junio> something like:

Junio> 	else
Junio>         	PAGER= ; export PAGER
Junio>                 git pull . origin &&
Junio>                 git log --pretty ORIG_HEAD..HEAD |
Junio>                 git shortlog
Junio> 	fi

However, this is good to know.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]