Re: git add -p with unmerged files (was: git add -p with new file)

2016-12-13 Thread Jeff King
On Tue, Dec 13, 2016 at 08:21:59PM +0100, Stephan Beyer wrote: > While we're on the topic that "git add -p" should behave like the > "normal" "git add" (not "git add -u"): what about unmerged changes? I agree that's a related part of the workflow, though the implementation is a bit harder. > Whe

git add -p with unmerged files (was: git add -p with new file)

2016-12-13 Thread Stephan Beyer
Hi, While we're on the topic that "git add -p" should behave like the "normal" "git add" (not "git add -u"): what about unmerged changes? When I have merge conflicts, I almost always use my aliases "edit-unmerged" and "add-unmerged": $ git config --global --list | grep unmerged alias.list-unmerg

Re: git add -p with new file

2016-12-13 Thread Junio C Hamano
Jeff King writes: >> Perhaps the latter is not advertised well enough? "add -p" does not >> even page so it is not very useful way to check what is being added >> if you are adding a new file (unless you are doing a toy example to >> add a 7-line file). > > I use "add -p" routinely for my final

Re: git add -p with new file

2016-12-13 Thread Jeff King
On Tue, Dec 13, 2016 at 10:48:07AM -0800, Junio C Hamano wrote: > > I think the problem is just that "add -p" does not give the whole story > > of what you might want to do before making a commit. > > The same is shared by "git diff [HEAD]", by the way. It is beyond > me why people use "add -p",

Re: git add -p with new file

2016-12-13 Thread Junio C Hamano
Jeff King writes: >> I am also not really sure what problem this feature is trying to solve. >> If the "problem"(?) is that it should act more like "git add" instead of >> "git add -u", for whatever reason, this may be fine (but the >> configuration option is a must-have then). > > I think the pr

Re: git add -p with new file

2016-12-13 Thread Jeff King
On Mon, Dec 12, 2016 at 09:31:03PM +0100, Stephan Beyer wrote: > I am also a "git add -p"-only user (except for new files and merges). > However, I usually keep a lot of untracked files in my repositories. > Files that I do not (git)ignore because I want to see them when I type > "git status". >

Re: git add -p with new file

2016-12-12 Thread Stephan Beyer
Hi, On 12/11/2016 02:00 PM, Jeff King wrote: > On Sat, Dec 10, 2016 at 02:04:33PM -0800, Junio C Hamano wrote: >> Jeff King writes: >>> On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote: >>> ... But it doesn't have to be that way. You could make add -p identical to add without optio

Re: git add -p with new file

2016-12-12 Thread Stephan Beyer
Hi Ariel, On 12/09/2016 07:26 PM, Ariel wrote: > On Wed, 7 Dec 2016, Duy Nguyen wrote: >> We could improve it a bit, suggesting the user to do git add -N. But >> is there a point of using -p on a new file? > > I got into the habit of always using -p as a way of checking my diffs > before committi

Re: git add -p with new file

2016-12-11 Thread Jeff King
On Sat, Dec 10, 2016 at 02:04:33PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote: > > ... > >> But it doesn't have to be that way. You could make add -p identical to add > >> without options, except the -p prompts to review diffs fir

Re: git add -p with new file

2016-12-10 Thread Junio C Hamano
Jeff King writes: > On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote: > ... >> But it doesn't have to be that way. You could make add -p identical to add >> without options, except the -p prompts to review diffs first. > > The question is whether you would annoy people using "-p" if you star

Re: git add -p with new file

2016-12-10 Thread Jeff King
On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote: > > It's contrary to the rest of git-add for specifying pathspecs to > > actually make things _more_ inclusive rather than less. > > Is it? Because git add without -p is happy to add new files. I was just speaking there of whether the presen

Re: git add -p with new file

2016-12-09 Thread Ariel
On Fri, 9 Dec 2016, Jeff King wrote: On Tue, Dec 06, 2016 at 08:18:59PM -0500, Ariel wrote: If you do git add -p new_file it says: No changes. Which is a rather confusing message. I would expect it to show me the content of the file in patch form, in the normal way that -p works, let m

Re: git add -p with new file

2016-12-09 Thread Ariel
On Wed, 7 Dec 2016, Duy Nguyen wrote: On Wed, Dec 7, 2016 at 8:18 AM, Ariel wrote: If you do git add -p new_file it says: No changes. Which is a rather confusing message. I would expect it to show me the content of the file in patch form, in the normal way that -p works, let me edit i

Re: git add -p with new file

2016-12-09 Thread Jeff King
On Tue, Dec 06, 2016 at 08:18:59PM -0500, Ariel wrote: > If you do git add -p new_file it says: > > No changes. > > Which is a rather confusing message. I would expect it to show me the > content of the file in patch form, in the normal way that -p works, let me > edit it, etc. > > (Note: I am

Re: git add -p with new file

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 8:18 AM, Ariel wrote: > > If you do git add -p new_file it says: > > No changes. > > Which is a rather confusing message. I would expect it to show me the > content of the file in patch form, in the normal way that -p works, let me > edit it, etc. We could improve it a bit,

git add -p with new file

2016-12-06 Thread Ariel
If you do git add -p new_file it says: No changes. Which is a rather confusing message. I would expect it to show me the content of the file in patch form, in the normal way that -p works, let me edit it, etc. (Note: I am aware I can do -N first, but when I specifically enter the name of a