git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: "Bráulio Bhavamitra" <brauliobo@gmail.com>,
	git@vger.kernel.org, "Matthieu Moy" <Matthieu.Moy@imag.fr>
Subject: Re: [git-users] Highlevel (but simple to implement) commands provided by default for git
Date: Wed, 29 May 2013 21:48:05 -0500	[thread overview]
Message-ID: <CAMP44s313TM_5=DGax4PfyiNf_eoWgf8Ls1g5h_uZ6_j3-2b=g@mail.gmail.com> (raw)
In-Reply-To: <CALkWK0=Sn2myT3QPCWJnoxKH4hm4s7MaB=UrPixP87MFSwKoug@mail.gmail.com>

On Wed, May 29, 2013 at 3:00 PM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Felipe Contreras wrote:
>> On Wed, May 29, 2013 at 1:26 PM, Ramkumar Ramachandra
>> <artagnon@gmail.com> wrote:
>>> Bráulio Bhavamitra wrote:
>>>>   root = rev-parse --show-toplevel
>>>
>>> What is your usecase for this?
>>
>> Some Git commands expect to be in the top level directory (e.g. git blame).
>
> Um, git blame revert.c when in builtin/ works for me: what am I missing?

I meant 'git bisect', but 'git blame' has a similar issue if it's
receiving it's arguments from other git commands.

>>>>  out = !git fetch `git upstream-remote` && git l `git upstream`..HEAD
>>>
>>> I didn't understand this at all.  What are you doing?
>>
>> Finding out what changes haven't been pushed out yet?
>
> ... but why would I want to club a slow network operation with
> something like log?  Yeah, I use git log @{u}.. all the time.

Then we would be out-of-date all the time.

>>>>  in = pull --dry-run
>>>
>>> Why?
>>
>> Because it's very easy to mess things up with 'git pull'. This
>> probably wouldn't be needed if we change the default of 'git pull' to
>> barf when the changes are not a fast-forward, and print a message
>> suggesting to either merge or rebase, as it has been suggested.
>
> Yeah, I saw that thread and I think shipping "sane" defaults is a lost
> cause.  I really want to make pull more useable, but by making it more
> configurable.

Sane defaults still make sense, and still will happen, sooner or later.

In the meantime 'pull --dry-run' makes sense.

>>>>  unmerged = !git ls-files --unmerged | cut -f2 | uniq
>>>>  untracked = ls-files --other --exclude-standard
>>>>  staged = ls-files --staged
>>>>  modified = ls-files --modified
>>>>  deleted = ls-files --deleted
>>>
>>> What is wrong with git status showing a unified output?
>>
>> It's not easy to be used in "scripts", say, 'gvim -p $(git unmerged)'.
>
> RIght, but we shouldn't ship anything "pretty" for scripts, otherwise
> it'll become hard to understand them.

Not at all. The user is specifically asking for unmerged files, a
straight-forward list is easier to understand that a list with a bunch
of other stuff the user is not interested in, where the user has to
manually browse with his eyes until he finds the section he is
interested in.

Your argument is akin to saying that 'ls foo' doesn't make sense,
because the user can see 'foo' when he does 'ls'. That defeats the
whole notion of letting the user query what he is looking for.

>>>>   head = !git l -1
>>>
>>> What is git l again?
>>
>> 'git log', of course.
>
> I use 'git show' all the time.

Even more characters to type.

>>>>  current = rev-parse --abbrev-ref HEAD
>>>
>>> Why don't you use a prompt?  Use the one in contrib/completion/git-prompt.sh.
>>
>> While this is probably a good idea, not everybody has a prompt
>> configured. Imagine ssh'ing to a machine you haven't touched before,
>> or shouldn't configure. Sure, right now you need to configure it
>> anyway, but the whole proposal is to make these default aliases.
>
> Like I said earlier, I'm really not interested in sane defaults: I
> don't think all of us can agree on one thing.

This is not a matter of "us" (developers) agreeing, it's a matter of
the vast majority of *users* suffering.

If you are not interested in them, then don't distract us that do.

>> In Mercurial 'hg branch' shows only the current branch, and I think
>> that's more appropriate.
>>
>> Before I configured my prompt, 'git branch' was by far the command I
>> used the most.
>
> Yeah, we're fixing 'git branch' (by making it more configurable): the
> topic is in progress.

This is about the default. 'git branch' doesn't do what it should *by
default*, so 'git current' makes sense in the meantime.

-- 
Felipe Contreras

  reply	other threads:[~2013-05-30  2:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f611150e-a12a-47f6-97f0-8aaff3045338@googlegroups.com>
     [not found] ` <f611150e-a12a-47f6-97f0-8aaff3045338-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2013-05-29 18:05   ` Highlevel (but simple to implement) commands provided by default for git Bráulio Bhavamitra
2013-05-29 18:11 ` Fwd: [git-users] " Bráulio Bhavamitra
2013-05-29 18:26   ` Ramkumar Ramachandra
2013-05-29 19:50     ` Felipe Contreras
2013-05-29 20:00       ` Ramkumar Ramachandra
2013-05-30  2:48         ` Felipe Contreras [this message]
2013-05-29 20:07       ` Junio C Hamano
2013-05-29 20:19         ` Ramkumar Ramachandra
2013-05-29 21:15           ` Junio C Hamano
2013-05-29 21:26             ` Ramkumar Ramachandra
2013-06-02 19:20               ` Junio C Hamano
2013-06-03 23:22         ` Duy Nguyen
2013-05-29 18:58   ` Fwd: " Junio C Hamano
2013-05-29 19:39   ` Felipe Contreras
2013-05-29 20:27     ` Ramkumar Ramachandra
     [not found]       ` <CAJri6_uScqjovt5eK9f9+Z4ehtsdYQNuiEX1MERiDBEJWueAXg@mail.gmail.com>
2013-05-29 21:32         ` Ramkumar Ramachandra
2013-05-29 23:43           ` Jonathan Nieder
2013-05-30  3:08             ` Felipe Contreras
2013-05-30  5:23               ` Jonathan Nieder
2013-05-30  5:28                 ` Felipe Contreras
2013-05-30 14:54                   ` Jonathan Nieder
2013-05-30 15:32                     ` Felipe Contreras
2013-05-30  7:30             ` Ramkumar Ramachandra
2013-05-30  3:04       ` Felipe Contreras

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMP44s313TM_5=DGax4PfyiNf_eoWgf8Ls1g5h_uZ6_j3-2b=g@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=artagnon@gmail.com \
    --cc=brauliobo@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).