Re: [PATCH v3 1/2] git-am: emit usage when called w/o arguments and w/o patch on stdin

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v3 1/2] git-am: emit usage when called w/o arguments and w/o patch on stdin

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:03

Jay Soffian [off-list ref] writes:
On Wed, Jan 28, 2009 at 11:18 AM, Pieter de Bie [off-list ref] wrote:
quoted
FWIW, I sometimes like to run 'git am', paste in a patch and hit ctrl-d.

I can probably retrain my finger to use 'git am -', but I'm not sure if that
works (after this patch)? At least it's not mentioned in the manpage.
"git am -" doesn't work (before or after this patch), but "cat | git am" will.
Another approach we've taken in other places to avoid the "Huh?" that
triggered this thread is to do something like:

        if there is no argument
        then
		if reading from tty
	        then
	        	echo >&2 "Reading from terminal, waiting for input..."
		fi
                process stdin	
	else
        	for arg
                do
                	process $arg
		done
	fi

Unfortunately, this will invalidate your "check -t 0 and error out" patch,
but some people may find it easier to work with and more friendly.

Re: [PATCH v3 1/2] git-am: emit usage when called w/o arguments and w/o patch on stdin

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:03

On Wed, Jan 28, 2009 at 1:15 PM, Junio C Hamano [off-list ref] wrote:
Another approach we've taken in other places to avoid the "Huh?" that
triggered this thread is to do something like:

       if there is no argument
       then
               if reading from tty
               then
                       echo >&2 "Reading from terminal, waiting for input..."
               fi
               process stdin
       else
               for arg
               do
                       process $arg
               done
       fi

Unfortunately, this will invalidate your "check -t 0 and error out" patch,
but some people may find it easier to work with and more friendly.
Well perhaps we should just deal w/ctrl-c only and ignore the terminal
check altogether.

j.

Re: [PATCH v3 1/2] git-am: emit usage when called w/o arguments and w/o patch on stdin

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:46:03

On Wed, Jan 28, 2009 at 19:26, Jay Soffian [off-list ref] wrote:
Well perhaps we should just deal w/ctrl-c only and ignore the terminal
check altogether.
That would suit my needs; as long as doing "git am" and then ^C does
not change my worktree and .git directory. Doing a stray "git am
--abort" after aborting does not obliterate my worktree as it does now
(not nice!), even so, it will change where my branch is currently at!

-- 
Cheers,

Sverre Rabbelier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help