From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Seymour Subject: [PATCH v5 0/8] detached-stash: regularise handling of stash arguments by git stash Date: Wed, 18 Aug 2010 23:09:32 +1000 Message-ID: <1282136980-25793-1-git-send-email-jon.seymour@gmail.com> Cc: gitster@pobox.com, j6t@kdbg.org, Jon Seymour To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Aug 18 15:10:24 2010 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 1OliPP-00015T-LT for gcvg-git-2@lo.gmane.org; Wed, 18 Aug 2010 15:10:24 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726Ab0HRNKS (ORCPT ); Wed, 18 Aug 2010 09:10:18 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:44168 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751725Ab0HRNKQ (ORCPT ); Wed, 18 Aug 2010 09:10:16 -0400 Received: by pvg2 with SMTP id 2so202375pvg.19 for ; Wed, 18 Aug 2010 06:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=KafjchTHM5lPq7EZqUMvpmO2N8Azm6YVwDKjuqOgDSM=; b=CA2DRcivZa8MwZRFit4GJXOGU2cPHSr46mOGx2FIc6afe5YI7iXELWcd8ZYTh3TQUy cuibAxkoOR5jjiJzwVii+8r3HkkQcZZeSsO19ch2+Z8iQKSX3OMsPhPMO1VvcJh60Xun r8XHT9dQisHTRc+zynrU9ijNAXTFjUe+CHa8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=jhi2qlkVJsnfXPrujcu7nicitsvLPhIq/URZVcp5mbjBJp+jaxJAGvQrJtbkNz+EeH UVE96C/R6OvQQPgJqWQArVUyc2EYrHUfPKypLLgYhcpGXwvV89Q0AiECo1EWQ7m2/uwr RsM1owMY4oJPh6ecrRK8dRS7tofaYm3peUGYY= Received: by 10.142.156.14 with SMTP id d14mr6966283wfe.267.1282137015924; Wed, 18 Aug 2010 06:10:15 -0700 (PDT) Received: from localhost.localdomain ([120.16.55.229]) by mx.google.com with ESMTPS id w31sm303253wfd.20.2010.08.18.06.10.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 18 Aug 2010 06:10:14 -0700 (PDT) X-Mailer: git-send-email 1.7.2.1.95.g4fabf Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: This patch introduces a common flags and revision parsing function to the following git stash commands: * apply * branch * pop * drop * show With these changes, git stash now: * allows non-stash log entry references to passed to 'stash branch' provided they are stash-like * relaxes the requirement that a stash log currently entry exists for 'stash show' or 'stash branch' * does not attempt to drop the specified revision if it doesn't look like a stash log entry reference * fails 'stash pop' and 'stash drop' early if the specified revision is not a stash log entry reference * fails early if more than one stash-like commit is specified * fails early if the specified revision is of the form ref@{n} and ref exists, but ref@{n} does not exist * reports various error conditions that can occur across multiple commanbds with consistent error messages. The implementation of several commands is simplified to a lesser or greater degree by taking advantage of the new common parsing and validation function, parse_flags_and_rev(). This revision incorporates feedback and corrections from Johannes Sixt and Junio Hamano. Jon Seymour (8): detached-stash: introduce parse_flags_and_revs function detached-stash: simplify stash_apply detached-stash: simplify stash_drop detached-stash: refactor git stash pop implementation detached-stash: simplify git stash branch detached-stash: simplify git stash show detached-stash: tests of git stash with stash-like arguments detached-stash: update Documentation Documentation/git-stash.txt | 16 ++- git-stash.sh | 223 ++++++++++++++++++++++++++++--------------- t/t3903-stash.sh | 140 +++++++++++++++++++++++++++ 3 files changed, 296 insertions(+), 83 deletions(-) -- 1.7.2.1.95.g969a4.dirty