From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Nieder Subject: [PATCH 2/3] checkout: introduce --detach synonym for "git checkout foo^{commit}" Date: Tue, 8 Feb 2011 04:32:49 -0600 Message-ID: <20110208103249.GC29660@elie> References: <20110207205934.GD13461@sigill.intra.peff.net> <20110207220030.GA19357@elie> <7vaai7s9g4.fsf@alter.siamese.dyndns.org> <20110207234526.GA28336@sigill.intra.peff.net> <20110208005238.GB24340@elie> <20110208102605.GA29660@elie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Junio C Hamano , Sverre Rabbelier , Martin von Zweigbergk , git@vger.kernel.org To: Jeff King X-From: git-owner@vger.kernel.org Tue Feb 08 11:33:01 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PmksW-00031q-NC for gcvg-git-2@lo.gmane.org; Tue, 08 Feb 2011 11:33:01 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220Ab1BHKc4 (ORCPT ); Tue, 8 Feb 2011 05:32:56 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:48584 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151Ab1BHKcy (ORCPT ); Tue, 8 Feb 2011 05:32:54 -0500 Received: by gyb11 with SMTP id 11so2143010gyb.19 for ; Tue, 08 Feb 2011 02:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=KXJKtI6QnWIWWwx7ICxV7Znoa3k4C9iejcubEb1VNlE=; b=sarVj1lhty7NOH/FbgO7OiXkx+iksyb7yHT1shMC66xfMe8CL8aDtzAZr8afYI/BLD Shff+CnpcwBI5pxLwUo1jV24ylJzy6mgMnkPkorZNqUYQA+7/mYGeIfrOgUPE0JTxWpX +claZn4jtP1tq6My3mC9kWst3IybD1R276i6w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=qMNGbXkGg6Sm/vD/SXaj3nY5GdS+oODawICCM2IJ5JfhkVPoRWa7xarNBU/AMkMGOK 08EHAkTkNIoQke/yeix6qT+hadvIhHspHkqNYsjZ2lr+VpaSw9UlnuJtJgzDRvAks/Oi A360gX0ZYqXrM0vnN/OPiRkkmEaBo1ku69zo4= Received: by 10.90.72.14 with SMTP id u14mr20448301aga.195.1297161173865; Tue, 08 Feb 2011 02:32:53 -0800 (PST) Received: from elie (adsl-76-206-235-233.dsl.chcgil.sbcglobal.net [76.206.235.233]) by mx.google.com with ESMTPS id i10sm6926935anh.32.2011.02.08.02.32.51 (version=SSLv3 cipher=RC4-MD5); Tue, 08 Feb 2011 02:32:52 -0800 (PST) Content-Disposition: inline In-Reply-To: <20110208102605.GA29660@elie> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: From: Junio C Hamano For example, one might use this when making a temporary merge to test that two topics work well together. Patch by Junio, with tests from Jeff King. [jn: with some extra checks for bogus commandline usage] Suggested-by: Jeff King Signed-off-by: Junio C Hamano Signed-off-by: Jonathan Nieder --- Documentation/git-checkout.txt | 13 +++++- builtin/checkout.c | 25 ++++++++-- t/t2020-checkout-detach.sh | 95 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 7 deletions(-) create mode 100755 t/t2020-checkout-detach.sh diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 22d3611..d162117 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- [verse] 'git checkout' [-q] [-f] [-m] [] +'git checkout' [-q] [-f] [-m] [--detach] [] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=