git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stephen Kelly <steveire@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Why doesn't gitk highlight commit references from git-describe?
Date: Wed, 13 Apr 2016 14:45:07 -0700	[thread overview]
Message-ID: <CAGZ79kY_C9wSS+z7XwPEWiM+8vhYuZzs_SPZ0mQR=LB+MPzTJg@mail.gmail.com> (raw)
In-Reply-To: <xmqqk2k1jita.fsf@gitster.mtv.corp.google.com>

On Wed, Apr 13, 2016 at 2:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> How would you know(/code) that v1.6.0-rc0~120^2 is a text worth linking?
>> "v1.6.0-rc0" is a custom string as that is how we name tags in this project.
>> It can follow any convention in other projects.
>>
>> Maybe a first approximation is if there is a `~` followed by numbers
>> or a ^ character, inspect the whole thing if it is a reference into the history?
>
> You (as a gitk process running in a repository) know what tags are
> in your repository, so you can find the above pattern and see if the
> prefix matches any of the known tag.  That way, you do not have to
> worry about having to special case HEAD etc.

Sorry for shooting from the hip here[1], that thought was

But it should not be just tags?

We also want to have 4b9ab0ee0130~1^2 to work `right`, in the sense
that not just the hexadecimals are highlighted and linking to 4b9ab0ee0130,
but the whole expression should link to 49e863b02ae177.

[1] My thinking was just like in https://xkcd.com/761/

Stephen Kelly:
> Would it be possible to implement linking for <tagname> optionally followed
> by something like that? Just tags should be links too, right?

right, just tags should work I'd expect.

> What does 'HEAD^' mean? If it is 'the commit before this one', then why not
> link it?

As said I was thinking about the git development, so see 5f3c3a4e6f11deda
for an example:

    files_log_ref_write: new function

    Because HEAD and stash are per-worktree, every refs backend needs to
    go through the files backend to write these refs.

    So create a new function, files_log_ref_write, and add it to
    refs/refs-internal.h. Later, we will use this to handle reflog updates
    for per-worktree symbolic refs (HEAD).

I do not think we would want to link HEAD to anything in that example.
(I'd have no idea what it would link to here, so just not link it?)

Thanks,
Stefan

  reply	other threads:[~2016-04-13 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 20:36 Why doesn't gitk highlight commit references from git-describe? Stephen Kelly
2016-04-13 21:27 ` Stefan Beller
2016-04-13 21:32   ` Junio C Hamano
2016-04-13 21:45     ` Stefan Beller [this message]
2016-04-13 21:50       ` Junio C Hamano
2016-04-13 21:55       ` Stephen Kelly
2016-04-13 21:57         ` Stephen Kelly
2016-04-13 21:41   ` Stephen Kelly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGZ79kY_C9wSS+z7XwPEWiM+8vhYuZzs_SPZ0mQR=LB+MPzTJg@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=steveire@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).