From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#57400: 29.0.50; Support sending patches from VC directly Date: Sat, 15 Oct 2022 11:44:58 +0000 Message-ID: <87r0z95n0l.fsf@posteo.net> References: <84v8qgn1z9.fsf@iki.fi> <87h70i9ntt.fsf@posteo.net> <87edvl6vbj.fsf@gmail.com> <8735c1nn3y.fsf@posteo.net> <877d1d6rcy.fsf@gmail.com> <867d1cjc8w.fsf@mail.linkov.net> <87o7unkggk.fsf@posteo.net> <86edvids93.fsf@mail.linkov.net> <87zge52nx0.fsf@posteo.net> <86sfjvqz68.fsf@mail.linkov.net> <87edvecg45.fsf@posteo.net> <86r0ze2ldb.fsf@mail.linkov.net> <871qrchzli.fsf@posteo.net> <86tu471vhq.fsf@mail.linkov.net> <875ygnjyp0.fsf@posteo.net> <87mt9zii8w.fsf@posteo.net> <831qrba2g1.fsf@gnu.org> <87ilknidkv.fsf@posteo.net> <83sfjq99vl.fsf@gnu.org> <87czau6ps0.fsf@posteo.net> <83o7ud7evv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19454"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, 57400@debbugs.gnu.org, ane@iki.fi, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 15 13:46:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojfcY-0004rg-9q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 13:46:26 +0200 Original-Received: from localhost ([::1]:45248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojfcW-00020F-Rs for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 07:46:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojfcB-0001xe-Ob for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 07:46:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojfcA-0002xf-JS for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 07:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojfcA-0003sJ-Dc for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 07:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2022 11:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57400 X-GNU-PR-Package: emacs Original-Received: via spool by 57400-submit@debbugs.gnu.org id=B57400.166583432014818 (code B ref 57400); Sat, 15 Oct 2022 11:46:02 +0000 Original-Received: (at 57400) by debbugs.gnu.org; 15 Oct 2022 11:45:20 +0000 Original-Received: from localhost ([127.0.0.1]:39649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojfbT-0003qw-NN for submit@debbugs.gnu.org; Sat, 15 Oct 2022 07:45:20 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:49761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojfbO-0003qV-De for 57400@debbugs.gnu.org; Sat, 15 Oct 2022 07:45:18 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3D99D240027 for <57400@debbugs.gnu.org>; Sat, 15 Oct 2022 13:45:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665834307; bh=cMpwpktnUyV8YfTcLy6AD1EefBMwGhIzjJwnMtYS4F4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=i4bFSpZY4Wln8jwpykDiwS8Cv/b51NctbNmNzU21qcOmkX0EHoqaWcKqHgHiF2GYG RUlKJO57EhQtF/EuVrMEx+lTdGsPjv8EewIpnGhSRINZxZB934ry0QuibzRFgG2MW6 YPObOjypkmD5sr26pGU0k6kGG4dlbs5De1tBIp/HS83cXHhwD8L0hL6BZ98d/SkbCs k+U3uM0yKC/Gkk75KqnRzAlkhzUElumsxiP4QWVqKVatWDrf7bKQwVG0AqpOxIFE++ /sYSsbUn8/1EwpZAwaiklpLGvmWXWpt3bApUlJ6+aFd/EinkymgOOkP6B5bRbYov7U JadhFuVbXbcSA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MqLz36yNjz9rxF; Sat, 15 Oct 2022 13:45:03 +0200 (CEST) In-Reply-To: <83o7ud7evv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Oct 2022 09:57:40 +0300") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245543 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: juri@linkov.net, rpluim@gmail.com, 57400@debbugs.gnu.org, ane@iki.fi >> Date: Fri, 14 Oct 2022 21:47:43 +0000 >> >> > Translate Git revision descriptor of COMMIT, a string, to a symbolic form. >> >> Is this perhaps not too long? Would "Translate revision string COMMIT >> to a symbolic form." be sufficient, especially as this is actually just >> an internal function that wasn't marked as such (the Git history >> indicates that this function, with this documentation string has been >> around since the initial revision of the file in 2007)? > > I disregarded the fact that this is an internal function, because the > issues are general. But yes, we could make this shorter, once we > agree that the full text should be something like I suggested. For > example: > > Translate revision string of COMMIT to a symbolic form. > > Note that I said "string of COMMIT", because COMMIT is not a string, > it is an entity which the string describes. Right, makes sense. >> >> If the optional argument FORCE is non-nil, >> >> this might include revision specifications like \"master~8\" (the >> >> 8th parent of the commit that \"master\" is currently pointing >> >> to). >> > >> > This begs the question: what kind of COMMIT strings are acceptable if >> > FORCE is nil or omitted? If we only accept SHA-1 hashes then, this >> > should perhaps be mentioned in the first sentence. But from reading >> > the (unhelpful) man page of "git name-rev" (which leads down the >> > rabbit hole to "git rev-parse"), it is my understanding that this will >> > accept _any_ revision descriptor in any form. >> >> Yes, right. And in absence of any restriction "COMMIT" should be >> understood to be a SHA-1 reference or a symbolic reference, right? > > Hmm... now I'm confused. I'd think COMMIT could be _any_ reference to > a revision, not just SHA-1? Because "git name-rev" accepts them all, > no? Yes? Maybe I am also confused, but my understanding is that a "commit reference" (e.g. the contents of COMMIT) is either a symbolic reference of a SHA-1 reference (non-symbolic). >> > So now I wonder why >> > accepting something like "master~8" needs a special knob: it's just >> > one of the forms supported by "git name-rev", isn't it? So maybe you >> > don't even need the additional argument and don't have to document it? >> >> That is an open debate, the function is currently only used in vc-git.el >> and is never invoked with the optional argument. I've only added it >> because it might be that it could be useful at some point in the future. >> >> > But if there _are_ valid reasons not to accept the likes of >> > "master~8", they should be in the doc string. For example: >> > >> > By default, COMMIT strings of the form "master~8" are rejected, >> > because , but if FORCE is non-nil, they >> > are allowed. >> >> I guess it is difficult to come up with a "valid reason", the motivation >> is that I wanted to have some way to ensure that >> `vc-git-working-revision' only returns a symbolic form iff a branch or >> tag is pointing to the working revision. If you think it is preferable, >> I could also invert the argument and make it into something like >> "no-relative" or even pull the check into `vc-git-working-revision'. > > I'm asking why not accept everything that "git name-rev" accepts, and > remove the need for the additional FORCE argument. (But this is not a > documentation issue anymore ;-) The function does accept everything that "git name-rev" accepts, after all it just passes commit to the subcommand. What FORCE does is restrict what "git name-rev" response is accepted to be returned by `vc-git-symbolic-commit'.