git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [git-users] Highlevel (but simple to implement) commands provided by default for git

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 29, 2013, 19:50 UTC
Message-ID
<CAMP44s1VFxarV4Gp5KsxhFKJbmd033-DW8koe9P4XUZQcX4mrA@mail.gmail.com>
In-Reply-To
<CALkWK0k8GkFYNkoGH4YCgmWtSR5rgFSG0dU9Aw2CO_arvuzKxQ@mail.gmail.com>

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).
>>  upstream-remote = !git upstream | sed -e 's/\\/.*$//g'
>
> Windows back-slashes?
Maybe git config quoting.
>>  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?
>>  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.

Show 7 quoted lines
>>  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)'.
>>   head = !git l -1
>
> What is git l again?
'git log', of course.
>>  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.

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.

-- 
Felipe Contreras
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 4 of 24 in “Re: Highlevel (but simple to implement) commands provided by default for git”
  1. Bráulio BhavamitraMay 29, 2013
  2. Fwd: [git-users] Highlevel (but simple to implement) commands provided by default for gitBráulio Bhavamitra, May 29, 2013
  3. Ramkumar RamachandraMay 29, 2013
  4. Felipe ContrerasMay 29, 2013
  5. Ramkumar RamachandraMay 29, 2013
  6. Felipe ContrerasMay 30, 2013
  7. Junio C HamanoMay 29, 2013
  8. Ramkumar RamachandraMay 29, 2013
  9. Junio C HamanoMay 29, 2013
  10. Ramkumar RamachandraMay 29, 2013
  11. Junio C HamanoJun 2, 2013
  12. Duy NguyenJun 3, 2013
  13. Junio C HamanoMay 29, 2013
  14. Felipe ContrerasMay 29, 2013
  15. Ramkumar RamachandraMay 29, 2013
  16. Felipe ContrerasMay 30, 2013
  17. Ramkumar RamachandraMay 29, 2013
  18. Jonathan NiederMay 29, 2013
  19. Felipe ContrerasMay 30, 2013
  20. Jonathan NiederMay 30, 2013
  21. Felipe ContrerasMay 30, 2013
  22. Jonathan NiederMay 30, 2013
  23. Felipe ContrerasMay 30, 2013
  24. Ramkumar RamachandraMay 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.