git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Small issue with "add untracked" option of 'git add -i'
Date: Mon, 12 Jun 2017 10:38:36 -0700	[thread overview]
Message-ID: <xmqqwp8hnm1v.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1497278015.7302.13.camel@gmail.com> (Kaartic Sivaraam's message of "Mon, 12 Jun 2017 20:03:35 +0530")

Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:

> * He chooses to use 'git add -i' to stage changes
> * He chooses option 4, accidentally, instead of option 5. He is shown
> the following menu,
>
>> *** Commands ***
>>   1: status	  2: update	  3: revert	  4: add
>> untracked
>>   5: patch	  6: diff	  7: quit	  8: help
>> What now> 4
>>   1: test-file
>> Add untracked>> 
>
> * He exits by hitting return but he is shown this weird message found
> below.
>
>> No untracked files.
>
> * He is surprised on seeing this.
>
> Why is that message shown when "there are untracked files" but the user
> doesn't add them to the staging area?

It comes from this snippet in git-add--interactive.perl:

        sub add_untracked_cmd {
                my @add = list_and_choose({ PROMPT => __('Add untracked') },
                                          list_untracked());
                if (@add) {
                        system(qw(git update-index --add --), @add);
                        say_n_paths('added', @add);
                } else {
                        print __("No untracked files.\n");
                }
                print "\n";
        }


After prompting to get the list of desired files, if the user chose
nothing, the message is shown.  "No untracked files chosen." is
probably what the code wants to say, I would think.

 git-add--interactive.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 709a5f6ce6..98c9f20578 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -711,7 +711,7 @@ sub add_untracked_cmd {
 		system(qw(git update-index --add --), @add);
 		say_n_paths('added', @add);
 	} else {
-		print __("No untracked files.\n");
+		print __("No untracked file chosen.\n");
 	}
 	print "\n";
 }

  reply	other threads:[~2017-06-12 17:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 14:33 Small issue with "add untracked" option of 'git add -i' Kaartic Sivaraam
2017-06-12 17:38 ` Junio C Hamano [this message]
2017-06-12 17:58   ` Kaartic Sivaraam
2017-06-12 17:59   ` Junio C Hamano
2017-06-14 13:04     ` Kaartic Sivaraam
2017-06-15  6:50       ` Kaartic Sivaraam
2017-06-21  2:55     ` Kaartic Sivaraam
2017-06-21  4:52       ` Kevin Daudt
2017-06-21 12:05         ` Kaartic Sivaraam
2017-06-22  3:13     ` Kaartic Sivaraam

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=xmqqwp8hnm1v.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kaarticsivaraam91196@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).