git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Subject: [RFC/PATCH 2/2] Add new 'git stage' script
Date: Sun,  5 Apr 2009 16:48:51 +0300	[thread overview]
Message-ID: <1238939331-10152-3-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1238939331-10152-2-git-send-email-felipe.contreras@gmail.com>

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Makefile     |    1 +
 git-stage.sh |   28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 git-stage.sh

diff --git a/Makefile b/Makefile
index 0c3de6b..a1837fc 100644
--- a/Makefile
+++ b/Makefile
@@ -291,6 +291,7 @@ SCRIPT_SH += git-rebase.sh
 SCRIPT_SH += git-repack.sh
 SCRIPT_SH += git-request-pull.sh
 SCRIPT_SH += git-sh-setup.sh
+SCRIPT_SH += git-stage.sh
 SCRIPT_SH += git-stash.sh
 SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
diff --git a/git-stage.sh b/git-stage.sh
new file mode 100644
index 0000000..a5b3ad8
--- /dev/null
+++ b/git-stage.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+case "$1" in
+add)
+        shift
+        git add $@
+        ;;
+rm)
+        shift
+        git rm --cached $@
+        ;;
+diff)
+        shift
+        git diff --cached $@
+        ;;
+import)
+        shift
+        git ls-files --modified --others --exclude-standard -z | \
+        git update-index --add --remove -z --stdin
+        ;;
+ls)
+        shift
+        git ls-files --stage $@
+        ;;
+*)
+        git add $@
+        ;;
+esac
-- 
1.6.2.2.406.g45db3f

  reply	other threads:[~2009-04-05 13:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05 13:48 [RFC/PATCH 0/2] New 'stage' command Felipe Contreras
2009-04-05 13:48 ` [RFC/PATCH 1/2] git: remote stage Felipe Contreras
2009-04-05 13:48   ` Felipe Contreras [this message]
2009-04-05 19:02 ` [RFC/PATCH 0/2] New 'stage' command Junio C Hamano
2009-04-05 19:28   ` Felipe Contreras
2009-04-05 19:33     ` Junio C Hamano
2009-04-05 19:59       ` Junio C Hamano
2009-04-05 20:41         ` Felipe Contreras
2009-04-05 20:55           ` Jay Soffian
2009-04-05 22:06             ` Felipe Contreras
2009-04-05 19:34     ` [RFC/PATCH 0/2] " Nicolas Sebrecht
2009-04-05 21:58 ` [RFC/PATCH 0/2] " Markus Heidelberg
2009-04-05 22:35   ` Felipe Contreras
2009-04-05 23:06     ` Björn Steinbrink
2009-04-05 23:23       ` Markus Heidelberg
2009-04-06  9:48         ` Björn Steinbrink
2009-04-05 23:17     ` Markus Heidelberg
2009-04-05 23:22       ` Sverre Rabbelier
2009-04-05 23:45         ` Johannes Schindelin
2009-04-06  9:37           ` Felipe Contreras
2009-04-06  3:24         ` David Aguilar
2009-04-06  5:17           ` Junio C Hamano
2009-04-06  5:53             ` David Aguilar
2009-04-06  6:18               ` Junio C Hamano
2009-04-06 13:20             ` David Kågedal
2009-04-06 13:42               ` David Kågedal
2009-04-06 18:30               ` Junio C Hamano
2009-04-06 19:13                 ` Felipe Contreras
2009-04-06 19:25                   ` Björn Steinbrink
2009-04-07 10:01                     ` Felipe Contreras
2009-04-07 12:45                       ` Johannes Schindelin
2009-04-06 20:49                 ` Matthieu Moy
2009-04-07  0:55                   ` Junio C Hamano
     [not found]                 ` <87skkligzb.fsf@krank.kagedal.org>
2009-04-07  1:02                   ` Junio C Hamano
2009-04-07  8:39                     ` Octavio Alvarez
     [not found]                       ` <878wmcj1fs.fsf@krank.kagedal.org>
2009-04-07 15:01                         ` Octavio Alvarez
2009-04-07  1:36                 ` Stefan Karpinski
2009-04-07  7:38                 ` Octavio Alvarez

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1238939331-10152-3-git-send-email-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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 NNTP newsgroup(s).