git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Myles Fong <i@myles.hk>
To: "git" <git@vger.kernel.org>
Subject: Possible bug report: git checkout tag problem
Date: Mon, 08 Jan 2018 11:50:19 +0800	[thread overview]
Message-ID: <160d3e3f291.df909f06277296.7997490218741761365@myles.hk> (raw)

Hi,

Brief description:
When two tags are pointing to the same commit, e.g. tagA and tagB, if I do `git checkout tagA` then `git checkout tagB`,  and then `git status`, it shows `HEAD detached at tagA`

Expected behaviour:
I'm expecting it to show `HEAD detached at tagB`, though I understand this makes no difference for the repo code, but still a bit confusing for me.

Found workaround:
If I do an extra step `git checkout master`, followed by `git checkout tagB`,  and then `git status`, it shows `HEAD detached at tagB` as expected. ("master" can be any branch name)

Affected version:
This happens with the latest git version 2.14.3.

Detailed background:
We have a system consists of many git repos, and are using tags of global version numbers to ensure the same version of repos are deployed in the whole system. Sometimes when we have a new minor version of the system, there is no new commits for some repos. Still we need a new version tag for those repos to match the system version number, so we put a new version tag pointing to the same commit as the previous version tag. This is how we ran into the above situation and I was suspecting that our deploying script didn't run properly when I see `HEAD detached at {old-version}` in some locations of a {new-version} system.
I'm not sure if this is an expected behaviour or not because I didn't found any useful information after some Goolgling, except the following discussion.

Related discussion:
I found this discussion to be related to the same problem:
https://stackoverflow.com/questions/30631000/git-checkout-tag-issues-tag-is-unchanged/30631434#30631434

Regards,
Myles Fong



             reply	other threads:[~2018-01-08  3:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  3:50 Myles Fong [this message]
2018-01-08 13:51 ` Possible bug report: git checkout tag problem Johannes Schindelin

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=160d3e3f291.df909f06277296.7997490218741761365@myles.hk \
    --to=i@myles.hk \
    --cc=git@vger.kernel.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).