0

Me and my friends have a repo where we just casually post projects we are working on.

Since we post different projects in there, we like to tag the commit with what project it is. However, it is apparently not possible to add the same tag to several commits?

Is there a way to do this anyhow? Or do we have to tag it with a unique tag everytime like "MyTag1", "MyTag2", ..?

Julian Declercq
  • 1,536
  • 3
  • 17
  • 32
  • 2
    I don't think that even makes sense. In git, a tag refers to a specific commit. Setting a tag to a new commit removes its association with the old one. I presume it's the same with Mercurial. What exactly do you expect to be able to do with a tag that refers to two or more different commits? – Keith Thompson Mar 18 '16 at 00:26
  • 1
    Thank you for your comment. Well I'd like to "Group" different commits together. In SourceTree there is a very nice interface [link](https://imgur.com/qKDbUc6) where you can select tags. I'd like to be able to click a tag and then see all the commits with that tag. But as you state it now, I see that a tag needs to be unique for a commit. Is there any way to achieve the effect of kind of grouping them though? – Julian Declercq Mar 18 '16 at 00:46
  • I don't know Mercurial very well (I'm a Git user). I'm even more ignorant about SourceTree. Update your question to be clearer about the kind of grouping you're looking for. – Keith Thompson Mar 18 '16 at 00:48
  • Is there any particular reason you're putting multiple projects in a single repository? Separating them into their own repositories looks like a simple solution to your problem. – ChrisGPT was on strike Mar 18 '16 at 04:12
  • 1
    It sounds to me like you're confusing the git concept of a "tag" with the generic concept of "tagging" things for grouping. A git tag is completely different than "tagging" a photo with a name or place. – BJ Myers Mar 19 '16 at 04:43
  • 1
    @BJ Myers, yes exactly. Is there something that mimics the "tag" concept that I want? :) – Julian Declercq Mar 19 '16 at 12:12

2 Answers2

1

I had the same issue, turns out SourceTree displays tags in a treeview based on naming convention - if you follow the steps in this answer: https://stackoverflow.com/a/10243236 - you will achieve what you were looking for:

Screenshot of Tag "tree" in SourceTree

0

Even if it will be possible (and it's impossible by design - tag is unique name of changeset), it will be meaningless anyway for monolitic repo. Revision (active|selected, current) is attribute of the whole repo, you can't (without dirty tricks) have part of repo in state A and part in state B.

You have to re-think about your workflow and tasks, which you want to solve with "multi-csets tags" ("Nice UI in SourceTree" isn't answer)

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110