Re: git commit -p with file arguments

2016-10-05 Thread Junio C Hamano
Duy Nguyen writes: >> At the least I think we should clarify this in the document. > > How about something like this? Would it help? > > -- 8< -- > Subject: [PATCH] git-commit.txt: clarify --patch mode with pathspec > > How pathspec is used, with and without --interactive/--patch, is > different.

Re: git commit -p with file arguments

2016-10-05 Thread Christian Neukirchen
Duy Nguyen writes: >> At the least I think we should clarify this in the document. > > How about something like this? Would it help? I think it captures the current behavior well. -- Christian Neukirchenhttp://chneukirchen.org

Re: git commit -p with file arguments

2016-10-05 Thread Duy Nguyen
On Fri, Sep 09, 2016 at 05:54:30PM +0700, Duy Nguyen wrote: > On Tue, Sep 6, 2016 at 4:08 AM, Christian Neukirchen > wrote: > > Hi, > > > > I noticed the following suprising behavior: > > > > % git --version > > git version 2.10.0 > > > > % git add bar > > % git status -s > > A bar > > M foo > >

Re: git commit -p with file arguments

2016-09-12 Thread Jakub Narębski
W dniu 12.09.2016 o 03:57, Junio C Hamano pisze: > Jacob Keller writes: > >> Yes, I'm actually confused by "git commit " *not* usinng what's >> in the index already, so I think that isn't intuitive as is. > > You are excused ;-) > > In ancient days, "git commit " was to add the contents > from

Re: git commit -p with file arguments

2016-09-11 Thread Jacob Keller
On Sun, Sep 11, 2016 at 6:57 PM, Junio C Hamano wrote: > > You are excused ;-) > > In ancient days, "git commit " was to add the contents > from working tree files that match to what is already in > the index and create a commit from that state. This ran against the > intuition of many users who

Re: git commit -p with file arguments

2016-09-11 Thread Junio C Hamano
Jacob Keller writes: > Yes, I'm actually confused by "git commit " *not* usinng what's > in the index already, so I think that isn't intuitive as is. You are excused ;-) In ancient days, "git commit " was to add the contents from working tree files that match to what is already in the index an

Re: git commit -p with file arguments

2016-09-11 Thread Jacob Keller
On Sun, Sep 11, 2016 at 2:50 PM, Junio C Hamano wrote: > Jakub Narębski writes: > >> I wonder, if git-commit is to acquire such feature, what would be the >> best interface. "git commit :0:./"? "git commit -o -p " >> (that is, "git commit --only --patch ")? > > Just do "git reset && git commit

Re: git commit -p with file arguments

2016-09-11 Thread Junio C Hamano
Jakub Narębski writes: > I wonder, if git-commit is to acquire such feature, what would be the > best interface. "git commit :0:./"? "git commit -o -p " > (that is, "git commit --only --patch ")? Just do "git reset && git commit -p ", I would say. Anything more elaborate would just confuse the

Re: git commit -p with file arguments

2016-09-10 Thread Jakub Narębski
W dniu 09.09.2016 o 22:52, Christian Neukirchen napisał: > Jakub Narębski writes: > >> Which means that with "git add -p && git commit ", >> the "git add -p " would carefully craft the state >> in the index... and "git commit " would take worktree version >> of for commit, ignoring what was in

Re: git commit -p with file arguments

2016-09-09 Thread Christian Neukirchen
Jakub Narębski writes: > Which means that with "git add -p && git commit ", > the "git add -p " would carefully craft the state > in the index... and "git commit " would take worktree version > of for commit, ignoring what was in the index :-( > > Currently there is no way to create commit out

Re: git commit -p with file arguments

2016-09-09 Thread Jakub Narębski
W dniu 09.09.2016 o 20:03, Junio C Hamano pisze: > Jacob Keller writes: > >> It wants to commit bar too because you already added bar before. It works >> like: >> >> "git add bar && git add -p foo && git commit" does it not? >> >> I fail to see why "git commit -p " would unstage the bar you >> a

Re: git commit -p with file arguments

2016-09-09 Thread Junio C Hamano
Jacob Keller writes: > It wants to commit bar too because you already added bar before. It works > like: > > "git add bar && git add -p foo && git commit" does it not? > > I fail to see why "git commit -p " would unstage the bar you > already added? Or am I missing some assumption here? Yes. "

Re: git commit -p with file arguments

2016-09-09 Thread Christian Neukirchen
Jacob Keller writes: > It wants to commit bar too because you already added bar before. It works > like: > > "git add bar && git add -p foo && git commit" does it not? > > I fail to see why "git commit -p " would unstage the bar you > already added? Or am I missing some assumption here? Yet the

Re: git commit -p with file arguments

2016-09-09 Thread Jacob Keller
On Mon, Sep 5, 2016 at 2:08 PM, Christian Neukirchen wrote: > Hi, > > I noticed the following suprising behavior: > > % git --version > git version 2.10.0 > > % git add bar > % git status -s > A bar > M foo > > % git commit -p foo > [stage a hunk] > ... > # Explicit paths specified without -i or

Re: git commit -p with file arguments

2016-09-09 Thread Duy Nguyen
On Tue, Sep 6, 2016 at 4:08 AM, Christian Neukirchen wrote: > Hi, > > I noticed the following suprising behavior: > > % git --version > git version 2.10.0 > > % git add bar > % git status -s > A bar > M foo > > % git commit -p foo > [stage a hunk] > ... > # Explicit paths specified without -i or

git commit -p with file arguments

2016-09-05 Thread Christian Neukirchen
Hi, I noticed the following suprising behavior: % git --version git version 2.10.0 % git add bar % git status -s A bar M foo % git commit -p foo [stage a hunk] ... # Explicit paths specified without -i or -o; assuming --only paths... # On branch master # Changes to be committed: # new