From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: git log question Date: Thu, 30 Nov 2017 20:15:51 +0700 Message-ID: References: <87bmjkgk6h.fsf@gmx.net> <920d2cc0-a9b8-b740-1b4a-51403a790f90@mnet-mail.de> <87wp28c6ul.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1512047825 19044 195.159.176.226 (30 Nov 2017 13:17:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Nov 2017 13:17:05 +0000 (UTC) Cc: Mathias Megyei , Emacs developers To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 30 14:16:55 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 1eKOhx-0004Jw-39 for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 14:16:53 +0100 Original-Received: from localhost ([::1]:48207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKOi4-0005Zv-C0 for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2017 08:17:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKOhO-0005Zf-K2 for emacs-devel@gnu.org; Thu, 30 Nov 2017 08:16:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKOhI-0000xu-GQ for emacs-devel@gnu.org; Thu, 30 Nov 2017 08:16:18 -0500 Original-Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:40387) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKOhI-0000xW-Ag for emacs-devel@gnu.org; Thu, 30 Nov 2017 08:16:12 -0500 Original-Received: by mail-oi0-x22e.google.com with SMTP id w125so4741934oie.7 for ; Thu, 30 Nov 2017 05:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rnB7fRv5yuXwdnIWhG+8Mto3ia4b0ECVuREUE08sEWU=; b=pEKG3h4TxSfCLe66cBBPMNtIk+7RnjNb0A8BbRCn7XXlt1Votra1salrvZNLZSERfc VD0XZvLG346HRGYqgobSGeZnVLIMeo+0T22n9YZ96pqYxGG5Mc2h4hdKjSnMheAjCW3/ sWMLNJQS08fvJ0p1VPOkwQPxX9Op2knulUPWP2p/Q6kjYyNC0wd4YFsmFY5BCxTEAkt9 2/tTHeLBcGWsns7nCbTxq0NrpKWlQI9YZsBzMLHJL1hi9FdWy8D1vSKd18Q2ObinfYRS KhRgZwig0SDKBRfM9hOi1E69CTJ1QyTK7YGSS6MJ03eLm8kVQMF/Go0veDKYXfE36oL9 HcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rnB7fRv5yuXwdnIWhG+8Mto3ia4b0ECVuREUE08sEWU=; b=KvZRRzeFN4axvtSVsy5qmawQNqgaFMLqd9ukF30WMokc3A+bSMaPXUALcavQQm9b/S +rQluDz232sGEkwqB731B2LdfIvLqqZES77ulmA3ar3e0poh+4ZUVSohkohDCQNkVlEp EZB97LRkIhZL0jBR6zfJCjs/BU1Fi++WlAJJZm/cp3mY9Aiq/9KEhqU6kCsFqBAz2Szv akZfuVt+romYt03ap+oPlmXQqzlcRoW1RCQhc1OskljFUgRdnmaFsbOzT0xOColu46pC Rwlm0fTXl6Ihp3jZz/xXMWslncaCpCXDmxbLrhSVIwm1HpkRDItQII6xEsBSu9j3jXWJ jkXw== X-Gm-Message-State: AJaThX755ZQ+OGVeyMB+bVa76CW5LpQVLmL9sP+qIG63h//MiJkuqh/7 tAoLoP5difWV73nqqZY+ey/gz9eHyD3UsL47DPk= X-Google-Smtp-Source: AGs4zMZwcpWyHLwlZfzIudcOoR3FXN2B6mPtFk+BBLTPiUEqiBkE75EZLkeShofl7Ip7BbBdbXOTEXpDSDx6AEW2mJE= X-Received: by 10.202.190.139 with SMTP id o133mr3077299oif.38.1512047771419; Thu, 30 Nov 2017 05:16:11 -0800 (PST) Original-Received: by 10.74.121.148 with HTTP; Thu, 30 Nov 2017 05:15:51 -0800 (PST) In-Reply-To: <87wp28c6ul.fsf@gmx.net> X-Google-Sender-Auth: Vc863BgupVD0HfzufhjQqBJUbj8 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22e 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:220540 Archived-At: On Thu, Nov 30, 2017 at 7:02 PM, Stephen Berman wrote: > I want to call `git > ' on a branch and see the commit only if it is indeed > on that branch, not on some other branch in the repository. From your > reply, it appears that git does not have such a command, but I have to > first call `git branch --contains ' and, if it shows the branch > I want, then call `git log -1'. If so, fine, though a bit > disappointing it's not more straightforward. You are trying to do two things at once: (1) determine if a commit is reachable from a branch, and (2) show the commit. But it seems Git does not have a command to do exactly that, or any means to intersect revision ranges in one command. This works: $ git merge-base --is-ancestor HEAD && git log -1 You might be able to define a Git alias to shorten it further.