Re: [RFC] revision: Add --sticky-default option

2018-10-18 Thread Junio C Hamano
Andreas Gruenbacher writes: >> > # is --stdin a selector, too? >> > branches | git log --stdin --not origin/master > > Yes, it's a positive selector (since --not doesn't apply to --stdin). But you should be able to do printf "%s\n" ^maint master | git rev-list --stdin Replace the

Re: [RFC] revision: Add --sticky-default option

2018-10-18 Thread Andreas Gruenbacher
On Thu, 18 Oct 2018 at 05:23, Junio C Hamano wrote: > Jeff King writes: > > > I'd probably call it something verbose and boring like > > --use-default-with-uninteresting or --default-on-negative. > > I dunno. > > These two names are improvement, but there needs a hint that the > change we are

Re: [RFC] revision: Add --sticky-default option

2018-10-18 Thread Andreas Gruenbacher
On Thu, 18 Oct 2018 at 08:59, Junio C Hamano wrote: > Jeff King writes: > > Just to play devil's advocate, how about this: > > > > git log --branches=jk/* --not origin/master > > > > Right now that shows nothing if there are no matching branches. But I > > think under the proposed behavior, it

Re: [RFC] revision: Add --sticky-default option

2018-10-18 Thread Junio C Hamano
Jeff King writes: > Just to play devil's advocate, how about this: > > git log --branches=jk/* --not origin/master > > Right now that shows nothing if there are no matching branches. But I > think under the proposed behavior, it would start showing HEAD, which > seems counter-intuitive. > > Or

Re: [RFC] revision: Add --sticky-default option

2018-10-18 Thread Jeff King
On Thu, Oct 18, 2018 at 12:23:26PM +0900, Junio C Hamano wrote: > Jeff King writes: > > > I'd probably call it something verbose and boring like > > --use-default-with-uninteresting or --default-on-negative. > > I dunno. > > These two names are improvement, but there needs a hint that the >

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Junio C Hamano
Jeff King writes: > I'd probably call it something verbose and boring like > --use-default-with-uninteresting or --default-on-negative. > I dunno. These two names are improvement, but there needs a hint that the change we are interested in is to use default even when revs are given as long as

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Jeff King
On Wed, Oct 17, 2018 at 03:53:41PM +0200, Andreas Gruenbacher wrote: > On Wed, 17 Oct 2018 at 11:12, Jeff King wrote: > > On Tue, Oct 16, 2018 at 11:24:38PM +0200, Andreas Gruenbacher wrote: > > > here's a long-overdue update of my proposal from August 29: > > > > > > [RFC] revision: Don't let

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Jeff King
On Wed, Oct 17, 2018 at 06:24:05AM -0700, Matthew DeVore wrote: > > Yuck, t4202 is a mix of older and newer styles. I'm OK with this as-is > > because you've matched the surrounding code, but these days I'd probably > > write: > > > > test_expect_success '--sticky-default ^' ' > > { > >

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Andreas Gruenbacher
On Wed, 17 Oct 2018 at 11:12, Jeff King wrote: > On Tue, Oct 16, 2018 at 11:24:38PM +0200, Andreas Gruenbacher wrote: > > here's a long-overdue update of my proposal from August 29: > > > > [RFC] revision: Don't let ^ cancel out the default > > > > Does this look more acceptable that my first

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Matthew DeVore
On Wed, 17 Oct 2018, Jeff King wrote: Yuck, t4202 is a mix of older and newer styles. I'm OK with this as-is because you've matched the surrounding code, but these days I'd probably write: test_expect_success '--sticky-default ^' ' { echo sixth echo

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Jeff King
On Tue, Oct 16, 2018 at 11:24:38PM +0200, Andreas Gruenbacher wrote: > here's a long-overdue update of my proposal from August 29: > > [RFC] revision: Don't let ^ cancel out the default > > Does this look more acceptable that my first shot? I think it's going in the right direction. The

[RFC] revision: Add --sticky-default option

2018-10-16 Thread Andreas Gruenbacher
Hi, here's a long-overdue update of my proposal from August 29: [RFC] revision: Don't let ^ cancel out the default Does this look more acceptable that my first shot? Thanks, Andreas -- Some commands like 'log' default to HEAD if no other revisions are specified on the command line or