From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: git log question Date: Thu, 30 Nov 2017 10:06:00 -0700 Organization: XCP-1 Message-ID: <24a86127-902e-fa6e-cc64-154a6e6487e4@lanl.gov> References: <87bmjkgk6h.fsf@gmx.net> <920d2cc0-a9b8-b740-1b4a-51403a790f90@mnet-mail.de> <87wp28c6ul.fsf@gmx.net> <87shcvdf27.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1512061689 9186 195.159.176.226 (30 Nov 2017 17:08:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Nov 2017 17:08:09 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 Cc: Mathias Megyei , Emacs developers To: Stephen Berman , Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 30 18:08:02 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKSJa-0001iH-Ht for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 18:07:58 +0100 Original-Received: from localhost ([::1]:49460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKSJh-0006zT-QG for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 12:08:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKSIv-0006ZU-Aj for emacs-devel@gnu.org; Thu, 30 Nov 2017 12:07:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKSIp-0000pr-8P for emacs-devel@gnu.org; Thu, 30 Nov 2017 12:07:17 -0500 Original-Received: from proofpoint7.lanl.gov ([204.121.3.46]:44268) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKSIo-0000o4-UN for emacs-devel@gnu.org; Thu, 30 Nov 2017 12:07:11 -0500 Original-Received: from pps.filterd (proofpoint7.lanl.gov [127.0.0.1]) by proofpoint7.lanl.gov (8.16.0.21/8.16.0.21) with SMTP id vAUH2JN6055177; Thu, 30 Nov 2017 10:06:01 -0700 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint7.lanl.gov with ESMTP id 2ef7sdr1sx-1; Thu, 30 Nov 2017 10:06:01 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 310E113A3665; Thu, 30 Nov 2017 10:06:01 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from bismuth.lanl.gov (bismuth.lanl.gov [128.165.246.103]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 077D413A2889; Thu, 30 Nov 2017 10:06:01 -0700 (MST) In-Reply-To: <87shcvdf27.fsf@gmx.net> Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-30_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711300223 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 204.121.3.46 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220555 Archived-At: (All these commands have been given by others in this thread; this message aims to better relate them to the questions asked.) > I find the following puzzling: > > steve [ ~/git/emacs-master ]$ git log --oneline | grep b407c521f2 > b407c521f2 Remove pinentry.el > > steve [ ~/git/emacs-26 ]$ git log --oneline | grep b407c521f2 > > The latter gives no output; yet: This command of course answers your original question: "Is commit C on branch B?". You could use "grep -q" to make it a test, but "git merge-base --is-ancestor C B" is more efficient. > steve [ ~/git/emacs-26 ]$ git log --oneline b407c521f2 -1 > b407c521f2 Remove pinentry.el > > That is, `git log' invoked with a specific commit will find that commit > even when it's not on the current branch but on another branch in this > repository, "git log" == "git log HEAD"; "git log X" reports X itself and all commits in its history. > but it appears unable to say which branch it's on. This is a different, dual question: "Which branches contain commit C?", for which the command is "git branch [-r|-a] --contains C". Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.