git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git add --interactive: Autoselect single patch file
@ 2008-02-28 11:15 Jörg Sommer
  2008-02-29  2:00 ` Xavier Maillard
  0 siblings, 1 reply; 6+ messages in thread
From: Jörg Sommer @ 2008-02-28 11:15 UTC (permalink / raw)
  To: git; +Cc: Jörg Sommer

If there's only one file to patch, select it automaticly and don't bother
the user. In the case he didn't want do patching, he can say 'd' at the
patch prompt.
---
 git-add--interactive.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index a0a81f1..77ad6fb 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -778,7 +778,7 @@ sub patch_update_cmd {
 		print STDERR "No changes.\n";
 		return 0;
 	}
-	if ($patch_mode) {
+	if ($patch_mode or @mods == 1) {
 		@them = @mods;
 	}
 	else {
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git add --interactive: Autoselect single patch file
  2008-02-28 11:15 [PATCH] git add --interactive: Autoselect single patch file Jörg Sommer
@ 2008-02-29  2:00 ` Xavier Maillard
  0 siblings, 0 replies; 6+ messages in thread
From: Xavier Maillard @ 2008-02-29  2:00 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: git, joerg


   If there's only one file to patch, select it automaticly and don't bother
   the user. In the case he didn't want do patching, he can say 'd' at the
   patch prompt.

Like this quick-win.

Tested-by: Xavier Maillard <xma@gnu.org>

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] git add --interactive: Autoselect single patch file
@ 2008-03-22  1:22 Jörg Sommer
  2008-03-22 14:51 ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Jörg Sommer @ 2008-03-22  1:22 UTC (permalink / raw)
  To: git; +Cc: normalperson, Jörg Sommer

If there's only one file to patch, select it automaticly and don't bother
the user. In the case he didn't want do patching, he can say 'd' at the
patch prompt.

Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de>
---
 git-add--interactive.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index a0a81f1..77ad6fb 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -778,7 +778,7 @@ sub patch_update_cmd {
 		print STDERR "No changes.\n";
 		return 0;
 	}
-	if ($patch_mode) {
+	if ($patch_mode or @mods == 1) {
 		@them = @mods;
 	}
 	else {
-- 
1.5.4.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git add --interactive: Autoselect single patch file
  2008-03-22  1:22 Jörg Sommer
@ 2008-03-22 14:51 ` Johannes Schindelin
  2008-03-22 15:41   ` Wincent Colaiuta
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2008-03-22 14:51 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: git, normalperson

[-- Attachment #1: Type: TEXT/PLAIN, Size: 417 bytes --]

Hi,

On Sat, 22 Mar 2008, Jörg Sommer wrote:

> If there's only one file to patch, select it automaticly and don't 
> bother the user. In the case he didn't want do patching, he can say 'd' 
> at the patch prompt.

It also triggers when you specified a single path:

	$ git add -i that-file.c

I like it.

However, if I already specify (a) file(s), could add -i not go to the 
[p]atch option right away?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git add --interactive: Autoselect single patch file
  2008-03-22 14:51 ` Johannes Schindelin
@ 2008-03-22 15:41   ` Wincent Colaiuta
  2008-03-22 16:00     ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Wincent Colaiuta @ 2008-03-22 15:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jörg Sommer, git, normalperson

El 22/3/2008, a las 15:51, Johannes Schindelin escribió:

> Hi,
>
> On Sat, 22 Mar 2008, Jörg Sommer wrote:
>
>> If there's only one file to patch, select it automaticly and don't
>> bother the user. In the case he didn't want do patching, he can say  
>> 'd'
>> at the patch prompt.
>
> It also triggers when you specified a single path:
>
> 	$ git add -i that-file.c
>
> I like it.
>
> However, if I already specify (a) file(s), could add -i not go to the
> [p]atch option right away?

That's what I originally wanted and I sent a couple of patches in to  
that effect some months back. But it was argued that it is useful for  
passed-in filepatterns to limit the scope of other operations in "git  
add -i", not just the [p] subcommand, and that in turn lead to the "-- 
patch" option being implemented. I can try to dig up the message-ids  
in question if you are interested.

Still, I use the [p] subcommand so often (and almost never use any of  
the other subcommands offered by "git add -i") that I have "git patch"  
set up as an alias for "git add --patch".

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git add --interactive: Autoselect single patch file
  2008-03-22 15:41   ` Wincent Colaiuta
@ 2008-03-22 16:00     ` Johannes Schindelin
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2008-03-22 16:00 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: Jörg Sommer, git, normalperson

[-- Attachment #1: Type: TEXT/PLAIN, Size: 863 bytes --]

Hi,

On Sat, 22 Mar 2008, Wincent Colaiuta wrote:

> El 22/3/2008, a las 15:51, Johannes Schindelin escribió:
> 
> >However, if I already specify (a) file(s), could add -i not go to the 
> >[p]atch option right away?
> 
> That's what I originally wanted and I sent a couple of patches in to 
> that effect some months back. But it was argued that it is useful for 
> passed-in filepatterns to limit the scope of other operations in "git 
> add -i", not just the [p] subcommand, and that in turn lead to the 
> "--patch" option being implemented. I can try to dig up the message-ids 
> in question if you are interested.
> 
> Still, I use the [p] subcommand so often (and almost never use any of 
> the other subcommands offered by "git add -i") that I have "git patch" 
> set up as an alias for "git add --patch".

Ah, I missed the --patch option.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-22 16:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-28 11:15 [PATCH] git add --interactive: Autoselect single patch file Jörg Sommer
2008-02-29  2:00 ` Xavier Maillard
  -- strict thread matches above, loose matches on Subject: below --
2008-03-22  1:22 Jörg Sommer
2008-03-22 14:51 ` Johannes Schindelin
2008-03-22 15:41   ` Wincent Colaiuta
2008-03-22 16:00     ` Johannes Schindelin

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).