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

Re: Proposal: "unadd" command / alias.

From
Theodore Y. Ts'o <tytso@mit.edu>
Date
Oct 27, 2020, 22:54 UTC
Message-ID
<20201027225403.GJ5691@mit.edu>
In-Reply-To
<CAAdniQ4vx4z9KnfvG7thzxf1xBa=P_nnbY1G=RTFUBb4Zxqeaw@mail.gmail.com>
On Wed, Oct 28, 2020 at 01:02:11AM +0300, Filipp Bakanov wrote:
> >> Indeed, I have a similar alias in my ~/.gitconfig
> 
> Why not just add it to git by default for everybody? revert-file is
> also ok, anything except `checkout HEAD --` will be good.

Because everyone may have their own favorite aliases? Just because *I* have the following aliases doesn't mean that everyone else would find them useful.

[alias]
	new = !gitk --all --not ORIG_HEAD
	dw = diff --stat --summary
	di = diff --stat --summary --cached
	dc = describe --contains
	revert-file = checkout HEAD --
	l  = log --pretty=format:'%Cred%h%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
	lr = log --reverse --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
	rl  = log -g --pretty=format:'%Cred%h%Creset %gd %gs %Cgreen(%gr)%Creset %s' --abbrev-commit
	rl1  = log -g --date=relative --pretty=format:'%Cred%h%Creset %gs %Cgreen%gd%Creset %s' --abbrev-commit
	lg  = log --graph --pretty=format:'%Cred%h%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
	lgt = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
	rlt = log -g --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
	lgt-nc = log --graph --pretty=format:'%h -%d %s (%cr)' --abbrev-commit
	st = status -s
	recent = for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)'
	gerrit-clone = !bash ggh gerrit-clone
	start = !bash ggh start
	upload = !bash ggh upload
	prune-branches = !bash ggh prune-branches
	fixes = log -1 --pretty=fixes

I have a huge number of bash aliases, and that doesn't mean everyone else should have those bash aliases. For that matter, I have the following in ~/bin/git-rp-ext4 so that I can type "git rp-ext4 tags/ext4_for_linus". But that doesn't mean this script is right for everyone....

Cheers,
					- Ted
#!/bin/sh

START=origin URL=git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git END=""

print_help ()
{
    PROG=$(basename "$0")
    echo "Usage: $PROG [-n] [--start <START COMMIT>] [--url <URL] [<END COMMIT>]"
    exit 1
}
while [ "$1" != "" ]; do
    case $1 in
	--start) shift
		 START="$1"
		 ;;
	--url) shift
	       URL="$1"
	       ;;
	-n) NO_ACTION="echo" ;;
	-*) print_help ;;
	*)
	    if test -n "$END"
	    then
		print_help
	    else
		END="$1"
	    fi
	    ;;
    esac
    shift
done
$NO_ACTION git request-pull "$START" "$URL" "$END"
Previous: Filipp BakanovNext: Filipp Bakanov
Message 5 of 12 in “Proposal: "unadd" command / alias.”
  1. Filipp BakanovOct 27, 2020
  2. Junio C HamanoOct 27, 2020
  3. Theodore Y. Ts'oOct 27, 2020
  4. Filipp BakanovOct 27, 2020
  5. Theodore Y. Ts'oOct 27, 2020
  6. Filipp BakanovOct 27, 2020
  7. Philip OakleyOct 28, 2020
  8. Pratyush YadavOct 28, 2020
  9. Filipp BakanovOct 28, 2020
  10. Junio C HamanoOct 28, 2020
  11. Konstantin TokarevOct 28, 2020
  12. Filipp BakanovOct 28, 2020

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.