From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-6.2 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A8939203C1 for ; Mon, 12 Dec 2016 20:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247AbcLLUb2 (ORCPT ); Mon, 12 Dec 2016 15:31:28 -0500 Received: from mout.gmx.net ([212.227.15.18]:60307 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932221AbcLLUb0 (ORCPT ); Mon, 12 Dec 2016 15:31:26 -0500 Received: from [192.168.178.43] ([88.71.239.96]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M2tXS-1cWhKA2m4U-00sfXi; Mon, 12 Dec 2016 21:31:04 +0100 Subject: Re: git add -p with new file To: Jeff King , Junio C Hamano References: <20161209141129.r53b4rbtgd76fn2a@sigill.intra.peff.net> <20161210085556.nwg3pbay367jqin5@sigill.intra.peff.net> <20161211130034.ygj5l2gbx33uknlk@sigill.intra.peff.net> Cc: Ariel , git@vger.kernel.org From: Stephan Beyer Message-ID: Date: Mon, 12 Dec 2016 21:31:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161211130034.ygj5l2gbx33uknlk@sigill.intra.peff.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-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sxZaqUCcQq69dwuFmHBNOTd72FW 7Wbf5PU Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 options, except the -p prompts to review diffs first. >>> >>> The question is whether you would annoy people using "-p" if you started >>> including untracked files by default. I agree because it's inherently an >>> interactive process that we can be looser with backwards compatibility. >> >> It might be interactive, but it will be irritating that we suddenly >> have to see hundreds of lines in an untracked file before we are >> asked to say "no I do not want to add this file" and have to do so >> for all the untracked files that happen to match the given pathspec. >> >> It might make it less irritating if one of the interactive choices >> offered in the first prompt were N that tells the command: "No, >> ignore all the untracked paths", though. I dunno. > > Yeah, I agree dumping the contents automatically is annoying. Ariel > suggested asking twice about each path, which sounds clunky to me. I'd > probably give a simple question, with an option to dump the contents. > Like: > > $ echo foo >untracked > $ git add -p > New file: untracked > Stage this file [y,n,v,q,a,d,/,e,?]? v <-- user types 'v' for "view" 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". Hence, the imagination only that "git add -p" starts to ask me for each untracked file feels like a lot of annoying "n" presses. I could imagine that it is okay-ish when it asks about the untracked files *after* all tracked paths have been processed (I guess this has been proposed before), so that I can safely quit. 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). For me, I often had the problem that I simply forgot to add new files...¹ Still I doubt that one would benefit from such a feature because either: - you do not have many untracked files (unlike me). You will see the untracked file (that should be tracked) in the "git status" output when you edit the commit message², then you abort-add-commit or commit-add-amend and everything is fine. Or: - you have a lot of untracked files (like me). You won't see the untracked file (that should be tracked) in the "git status" output (you ignore it because the list is so long) and you won't see it in the "git add -p" run because you quit before seeing that file. So I have mixed feelings... > I'd also probably add interactive.showUntracked to make the whole thing > optional (but I think it would be OK to default it to on). Hm, "interactive.showUntracked" is a confusing name because "git add -i" (interactive) already handles untracked files. Best Stephan ¹ I do not have that problem any more because I got used to add new files right after saving, in a very early state, and then I simply use "git add -p"... ² Unless you use git commit -m ... But using "git commit -m" without "git status" before is user-issue anyway.