From: Jeff King <firstname.lastname@example.org> To: Emily Shaffer <email@example.com> Cc: Jonathan Tan <firstname.lastname@example.org>, email@example.com Subject: Re: Git in Outreachy December 2019? Date: Mon, 23 Sep 2019 15:40:05 -0400 [thread overview] Message-ID: <20190923194004.GF21344@sigill.intra.peff.net> (raw) In-Reply-To: <20190921014701.GA191795@google.com> On Fri, Sep 20, 2019 at 06:47:01PM -0700, Emily Shaffer wrote: > """ > "Did You Mean..?" > > There are some situations where it's fairly clear what a user meant to > do, even though they did not do that thing correctly. For example, if a > user runs `git commit` with tracked, modified, unstaged files in their > worktree, but no staged files at all, it's fairly likely that they > simply forgot to add the files they wanted. In this case, the error > message is slightly obtuse: > > $ git commit > On branch master > Changes not staged for commit: > modified: foo.txt > > no changes added to commit > > > Since we have an idea of what the user _meant_ to do, we can offer > something more like: > > $ git commit > On branch master > Changes not staged for commit: > modified: foo.txt > > Stage listed changes and continue? [Y/n] > > While the above case is a good starting place, other similar cases can > be added afterwards if time permits. These helper prompts should be > enabled/disabled via a config option so that people who are used to > their current workflow won't be impacted. > """ This is an interesting idea. At first I thought it might be too small for a project, but I think it could be expanded or contracted as much as the time allows by just looking for more "did you mean" spots. I have mixed feelings on making things interactive. For one, it gets awkward when Git commands are called as part of a script or other program (and a lot of programs like git-commit ride the line of plumbing and porcelain). I know this would kick in only when a config option is set, but I think that might things even _more_ confusing, as something that works for one user (without the config) would start behaving weirdly for another. I also think it might be an opportunity to educate. Instead of giving a yes/no prompt, we can actually recommend one (or more!) sets of commands to get the desired effect. I _thought_ we already did for this case by default (triggered by advice.statusHints, which is true by default). But it looks like those don't get printed for git-commit? -Peff
next prev parent reply other threads:[~2019-09-23 19:40 UTC|newest] Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-27 5:17 Jeff King 2019-08-31 7:58 ` Christian Couder 2019-08-31 19:44 ` Olga Telezhnaya 2019-09-04 19:41 ` Jeff King 2019-09-05 7:24 ` Christian Couder 2019-09-05 19:39 ` Emily Shaffer 2019-09-06 11:55 ` Carlo Arenas 2019-09-07 6:39 ` Jeff King 2019-09-07 10:13 ` Carlo Arenas 2019-09-07 6:36 ` Jeff King 2019-09-08 14:56 ` Pratyush Yadav 2019-09-09 17:00 ` Jeff King 2019-09-23 18:07 ` SZEDER Gábor 2019-09-26 9:47 ` SZEDER Gábor 2019-09-26 19:32 ` Johannes Schindelin 2019-09-26 21:54 ` SZEDER Gábor 2019-09-26 11:42 ` Johannes Schindelin 2019-09-13 20:03 ` Jonathan Tan 2019-09-13 20:51 ` Jeff King 2019-09-16 18:42 ` Emily Shaffer 2019-09-16 21:33 ` Eric Wong 2019-09-16 21:44 ` SZEDER Gábor 2019-09-16 23:13 ` Jonathan Nieder 2019-09-17 0:59 ` Jeff King 2019-09-17 11:23 ` Johannes Schindelin 2019-09-17 12:02 ` SZEDER Gábor 2019-09-23 12:47 ` Johannes Schindelin 2019-09-23 16:58 ` SZEDER Gábor 2019-09-26 11:04 ` Johannes Schindelin 2019-09-26 13:28 ` SZEDER Gábor 2019-09-26 19:39 ` Johannes Schindelin 2019-09-26 21:44 ` SZEDER Gábor 2019-09-27 22:18 ` Jeff King 2019-10-09 17:25 ` SZEDER Gábor 2019-10-11 6:34 ` Jeff King 2019-09-23 18:19 ` Jeff King 2019-09-24 14:30 ` Johannes Schindelin 2019-09-17 15:10 ` Christian Couder 2019-09-23 12:50 ` Johannes Schindelin 2019-09-23 19:30 ` Jeff King 2019-09-23 18:07 ` Jeff King 2019-09-24 14:25 ` Johannes Schindelin 2019-09-24 15:33 ` Jeff King 2019-09-28 3:56 ` Junio C Hamano 2019-09-24 0:55 ` Eric Wong 2019-09-26 12:45 ` Johannes Schindelin 2019-09-30 8:55 ` Eric Wong 2019-09-28 4:01 ` Junio C Hamano 2019-09-20 17:04 ` Jonathan Tan 2019-09-21 1:47 ` Emily Shaffer 2019-09-23 14:23 ` Christian Couder 2019-09-23 19:40 ` Jeff King [this message] 2019-09-23 22:29 ` Philip Oakley 2019-10-22 21:16 ` Emily Shaffer 2019-09-23 11:49 ` Christian Couder 2019-09-23 17:58 ` Jonathan Tan 2019-09-23 19:27 ` Jeff King 2019-09-23 20:48 ` Jonathan Tan 2019-09-23 19:15 ` Jeff King 2019-09-23 20:38 ` Jonathan Tan 2019-09-23 21:28 ` Jeff King 2019-09-24 17:07 ` Jonathan Tan 2019-09-26 7:09 ` Jeff King
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=20190923194004.GF21344@sigill.intra.peff.net \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: Git in Outreachy December 2019?' \ /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
Code repositories for project(s) associated with this 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).