git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christos Pappas <chrispappas99@gmail.com>
Cc: Martin Fick <mfick@codeaurora.org>,
	git@vger.kernel.org, annulen@yandex.ru
Subject: Re: [Feature request] Give non-unique names to commits for grouping
Date: Wed, 11 Mar 2020 13:04:14 -0700	[thread overview]
Message-ID: <xmqqeetyhd4x.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAGa6KtQ2dQWPWxbk2MH8QJxemM8QD_O=B3aYzsP5AH-sN-7PSw@mail.gmail.com> (Christos Pappas's message of "Wed, 11 Mar 2020 20:56:44 +0200")

Christos Pappas <chrispappas99@gmail.com> writes:

> Thank you for your answers.
>
> From what I can deduce, both of your suggestions require that the
> commit messages(or notes) must have some special text for which we can
> search for, which is hacky and would be different on every repository.
>
> What I am suggesting is something like, labels on GitHub, hashtags on
> Social-Media, or Tags in News sites. It's a well known concept so it
> will be easy to understand and use.

By "hashtags", do you mean #hashtags, i.e. you must add some special
text for which you can search for?  That does sound just as hacky as
any other embedded text in the messages of commit objects.

One large downside of embedding text (or #hashtags) in the message
of a commit object is that you need to plan ahead and know what
group the commit belongs to before you make it, but in general, it
is unreasonable to expect perfect foresight.  Often you do not know
what group the commit belongs to (e.g. you may want to label the set
of commits that broke the latest release for feature 'frotz' with
hashtag "#broke-frotz", but most likely you didn't know you were
breaking the feature when you were creating these commits).  Adding
these offending commit objects some comments in the form of notes
objects can be done retroactively, and as long as the set of
"tag-worthy" commits is minority among all commits, grepping for
"#hashtag" in the notes to find the notes that contain the tags you
wanted should be cheaper than "git log --grep" which must read all
the commits in the history.

Another way may be "git notes --ref broke-frotz add X -m . X" (and
similarly for Y and Z that also belong to "#broke-frotz" set of
commits) to mark them with an almost empty note in refs/notes/broke-frotz
hierarchy.  Then "git notes --ref broke-frotz list" should be able
to list these commits that have any notes in refs/notes/broke-frotz
and there is no need for grepping.  Of course you can make it richer
by describing why each of X, Y, and Z are in the "broke-frotz" set
when you give the notes text to them.




      parent reply	other threads:[~2020-03-11 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 23:16 [Feature request] Give non-unique names to commits for grouping Christos Pappas
2020-03-10 23:21 ` Konstantin Tokarev
2020-03-11 16:00 ` Martin Fick
2020-03-11 18:56   ` Christos Pappas
2020-03-11 19:31     ` Martin Fick
2020-03-11 20:47       ` Christos Pappas
2020-03-11 20:04     ` Junio C Hamano [this message]

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=xmqqeetyhd4x.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=annulen@yandex.ru \
    --cc=chrispappas99@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mfick@codeaurora.org \
    /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).