git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Seth Falcon <sethfalcon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git-commit: select which files to commit while editing the commit message
Date: Fri, 08 Dec 2006 16:59:50 -0800	[thread overview]
Message-ID: <7vfybpg9yx.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <m2d56taoqu.fsf@ziti.local> (Seth Falcon's message of "Fri, 08 Dec 2006 16:37:13 -0800")

Seth Falcon <sethfalcon@gmail.com> writes:

> I don't think I understand what an --exclude=<pattern> option would
> do, but I'm pretty sure it doesn't help the use case I'm thinking of:
>
>    Editing away, you've made changes in 8 files.
>
>    Reviewing diff, you want to commit 6 of those and continue working
>    on the other two.
>
>    It seems that there could be a less manual way than 
>    git update-index f1 f2 ... f6
>
>
> Hmm, maybe I could do:
>
>    git diff --name-only > changed
>    ## edit changed
>    cat changed|xargs git update-index
>
> I suppose this could be wrapped in a simple way to bring up an editor.

Note that output of cat piped to anything is almost always a bad
programming ;-)

Maybe the "git add --interactive" would give you a transcript
like this:

        $ git add --interactive '*.c' '*.h'
	showing list of modified files...
         1) bozbar.c 2) filfre.c 3) frotz.h 4) nitfol.c 5) rezrov.h
         6) xyzzy.c  7) yomin.h  8) z.c
        choice> 2 3 5 6 7
	showing list of modified files...
         1) bozbar.c 2* filfre.c 3* frotz.h 4) nitfol.c 5* rezrov.h
         6* xyzzy.c  7* yomin.h  8) z.c
        choice> 4+
	showing "git diff -- nitfol.c"...
        diff --git a/nitfol.c b/nitfol.c
        @@ -22,x +22,y @@
         {
        -	int i;
        +	long i;
        +	i = 314;
	 
        stage this hunk [Yes/No/All/Done]? y
        ...
 
The latter half is to come up with a subset of diff and then run
"git-apply --cached" to update only the index with the chosen
hunks.

  reply	other threads:[~2006-12-09  0:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-08 12:36 git-commit: select which files to commit while editing the commit message Pazu
2006-12-08 19:18 ` Junio C Hamano
2006-12-08 19:32   ` Jakub Narebski
2006-12-08 20:45     ` Luben Tuikov
2006-12-08 22:10       ` Josef Weidendorfer
2006-12-08 23:59         ` Seth Falcon
2006-12-09  0:07           ` Jakub Narebski
2006-12-09  0:37             ` Seth Falcon
2006-12-09  0:59               ` Junio C Hamano [this message]
2006-12-10  0:46                 ` Josef Weidendorfer
2006-12-10  0:54                   ` Junio C Hamano
2006-12-11  9:23                     ` [PATCH] git-add --interactive (wip) Junio C Hamano
2006-12-11 10:47                       ` Josef Weidendorfer
2006-12-12 21:51                         ` Junio C Hamano
2006-12-12 22:15                           ` Johannes Schindelin
2006-12-13  9:20                             ` Andreas Ericsson
2006-12-13  3:15                           ` Josef Weidendorfer
2006-12-13  5:34                             ` Junio C Hamano
2006-12-13 10:42                               ` Johannes Schindelin
2006-12-13 10:57                                 ` Shawn Pearce
2006-12-13 11:20                                   ` Johannes Schindelin
2006-12-13 20:31                               ` Josef Weidendorfer
2006-12-09  7:02   ` git-commit: select which files to commit while editing the commit message Sean

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=7vfybpg9yx.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=sethfalcon@gmail.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.
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).