git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Johan Herland <johan@herland.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v2] branch/checkout --track: Ensure that upstream branch is indeed a branch
Date: Thu, 17 Feb 2011 19:45:59 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1102171937460.14950@debian> (raw)
In-Reply-To: <201102170012.20964.johan@herland.net>

On Thu, 17 Feb 2011, Johan Herland wrote:

> When creating a new branch using the --track option, we must make sure that
> we don't try to set an upstream that does not make sense to follow (using
> 'git pull') or update (using 'git push'). The current code checks against
> using HEAD as upstream (since tracking a symref doesn't make sense). However,
> tracking a tag doesn't make sense either. Indeed, tracking _any_ ref that is
> not a (local or remote) branch doesn't make sense, and should be disallowed.
> 
> This patch achieves this by checking that the ref we're trying to --track
> resides within refs/heads/* or refs/remotes/*. This new check replaces the
> previous check against HEAD.

In some workflows (e.g. Linux kernel, IIRC), it is recommended to base
your work on a tag. Is it worth considering that people might use a
tag as upstream for such cases or would that be considered abuse of
the "upstream" concept? It could make sense to set an upstream to
point to a tag for reference and to be able to use e.g. 'rebase -i
@{u}', 'git log @{u}..' and similar.


/Martin

  reply	other threads:[~2011-02-18  0:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 17:52 checkout/branch needs some extra safety around the --track option Johan Herland
2011-02-15 20:04 ` Junio C Hamano
2011-02-16 10:46   ` [PATCH] branch/checkout --track: Ensure that upstream branch is indeed a branch Johan Herland
2011-02-16 22:00     ` Junio C Hamano
2011-02-16 23:12       ` [PATCH v2] " Johan Herland
2011-02-18  0:45         ` Martin von Zweigbergk [this message]
2011-02-18  4:32           ` Junio C Hamano

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=alpine.DEB.2.00.1102171937460.14950@debian \
    --to=martin.von.zweigbergk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.net \
    /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).