git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] build: add default configuration
@ 2013-09-21 11:47 Felipe Contreras
  2013-09-21 17:50 ` David Aguilar
  2013-09-21 18:58 ` Johannes Sixt
  0 siblings, 2 replies; 7+ messages in thread
From: Felipe Contreras @ 2013-09-21 11:47 UTC (permalink / raw)
  To: git; +Cc: David Aguilar, Felipe Contreras

For now simply add a few common aliases.

  co = checkout
  ci = commit
  rb = rebase
  st = status

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/git-checkout.txt | 5 +++++
 Documentation/git-commit.txt   | 5 +++++
 Documentation/git-rebase.txt   | 5 +++++
 Documentation/git-status.txt   | 5 +++++
 Makefile                       | 5 ++++-
 gitconfig                      | 5 +++++
 6 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 gitconfig

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index ca118ac..7597813 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -14,6 +14,11 @@ SYNOPSIS
 'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
 'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
 
+ALIAS
+-----
+
+git co
+
 DESCRIPTION
 -----------
 Updates files in the working tree to match the version in the index
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 1a7616c..8705abc 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -15,6 +15,11 @@ SYNOPSIS
 	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
 	   [-i | -o] [-S[<keyid>]] [--] [<file>...]
 
+ALIAS
+-----
+
+git ci
+
 DESCRIPTION
 -----------
 Stores the current contents of the index in a new commit along
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 6b2e1c8..69b192d 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -14,6 +14,11 @@ SYNOPSIS
 	--root [<branch>]
 'git rebase' --continue | --skip | --abort | --edit-todo
 
+ALIAS
+-----
+
+git co
+
 DESCRIPTION
 -----------
 If <branch> is specified, 'git rebase' will perform an automatic
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 9046df9..30ecd25 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -11,6 +11,11 @@ SYNOPSIS
 [verse]
 'git status' [<options>...] [--] [<pathspec>...]
 
+ALIAS
+-----
+
+git st
+
 DESCRIPTION
 -----------
 Displays paths that have differences between the index file and the
diff --git a/Makefile b/Makefile
index 3588ca1..18081bf 100644
--- a/Makefile
+++ b/Makefile
@@ -1010,7 +1010,7 @@ ifndef sysconfdir
 ifeq ($(prefix),/usr)
 sysconfdir = /etc
 else
-sysconfdir = etc
+sysconfdir = $(prefix)/etc
 endif
 endif
 
@@ -1586,6 +1586,7 @@ template_dir_SQ = $(subst ','\'',$(template_dir))
 htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
 prefix_SQ = $(subst ','\'',$(prefix))
 gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
+sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
@@ -2340,6 +2341,8 @@ install: all
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
 	$(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)'
+	$(INSTALL) -m 644 gitconfig '$(DESTDIR_SQ)$(ETC_GITCONFIG_SQ)'
 ifndef NO_GETTEXT
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'
 	(cd po/build/locale && $(TAR) cf - .) | \
diff --git a/gitconfig b/gitconfig
new file mode 100644
index 0000000..c45d300
--- /dev/null
+++ b/gitconfig
@@ -0,0 +1,5 @@
+[alias]
+	co = checkout
+	ci = commit
+	rb = rebase
+	st = status
-- 
1.8.4.9.g218b36e.dirty

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-21 11:47 [PATCH v2] build: add default configuration Felipe Contreras
@ 2013-09-21 17:50 ` David Aguilar
  2013-09-21 18:58 ` Johannes Sixt
  1 sibling, 0 replies; 7+ messages in thread
From: David Aguilar @ 2013-09-21 17:50 UTC (permalink / raw)
  To: Felipe Contreras, git

Felipe Contreras <felipe.contreras@gmail.com> wrote:
>For now simply add a few common aliases.
>
>  co = checkout
>  ci = commit
>  rb = rebase
>  st = status
>
>Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>---
> Documentation/git-checkout.txt | 5 +++++
> Documentation/git-commit.txt   | 5 +++++
> Documentation/git-rebase.txt   | 5 +++++
> Documentation/git-status.txt   | 5 +++++
> Makefile                       | 5 ++++-
> gitconfig                      | 5 +++++
> 6 files changed, 29 insertions(+), 1 deletion(-)

The .spec.in file contains a manifest of all the files provided by the git package. We're adding a new file so there may be a %{sysconfdir}/gitconfig entry needed there.  

> create mode 100644 gitconfig
>
>diff --git a/Documentation/git-checkout.txt
>b/Documentation/git-checkout.txt
>index ca118ac..7597813 100644
>--- a/Documentation/git-checkout.txt
>+++ b/Documentation/git-checkout.txt
>@@ -14,6 +14,11 @@ SYNOPSIS
>'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>]
>[--] <paths>...
> 'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
> 
>+ALIAS
>+-----
>+
>+git co
>+
> DESCRIPTION
> -----------
> Updates files in the working tree to match the version in the index
>diff --git a/Documentation/git-commit.txt
>b/Documentation/git-commit.txt
>index 1a7616c..8705abc 100644
>--- a/Documentation/git-commit.txt
>+++ b/Documentation/git-commit.txt
>@@ -15,6 +15,11 @@ SYNOPSIS
> 	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
> 	   [-i | -o] [-S[<keyid>]] [--] [<file>...]
> 
>+ALIAS
>+-----
>+
>+git ci
>+
> DESCRIPTION
> -----------
> Stores the current contents of the index in a new commit along
>diff --git a/Documentation/git-rebase.txt
>b/Documentation/git-rebase.txt
>index 6b2e1c8..69b192d 100644
>--- a/Documentation/git-rebase.txt
>+++ b/Documentation/git-rebase.txt
>@@ -14,6 +14,11 @@ SYNOPSIS
> 	--root [<branch>]
> 'git rebase' --continue | --skip | --abort | --edit-todo
> 
>+ALIAS
>+-----
>+
>+git co

Typofix: git rb

>+
> DESCRIPTION
> -----------
> If <branch> is specified, 'git rebase' will perform an automatic
>diff --git a/Documentation/git-status.txt
>b/Documentation/git-status.txt
>index 9046df9..30ecd25 100644
>--- a/Documentation/git-status.txt
>+++ b/Documentation/git-status.txt
>@@ -11,6 +11,11 @@ SYNOPSIS
> [verse]
> 'git status' [<options>...] [--] [<pathspec>...]
> 
>+ALIAS
>+-----
>+
>+git st
>+
> DESCRIPTION
> -----------
> Displays paths that have differences between the index file and the
>diff --git a/Makefile b/Makefile
>index 3588ca1..18081bf 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -1010,7 +1010,7 @@ ifndef sysconfdir
> ifeq ($(prefix),/usr)
> sysconfdir = /etc
> else
>-sysconfdir = etc
>+sysconfdir = $(prefix)/etc
> endif
> endif

Hmmm that's odd that the original used just "etc", but this seems correct (I don't have a machine around to check).

One small complication here is Mac OS X -- I always end up needing to special-case it to use /private/etc because /etc is a symlink and it's very easy to break the system by replacing it with a real directory.  Kinda ugly, but it's best to be safe.  I learned that the hard way.

> 
>@@ -1586,6 +1586,7 @@ template_dir_SQ = $(subst ','\'',$(template_dir))
> htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
> prefix_SQ = $(subst ','\'',$(prefix))
> gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
>+sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
> 
> SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
> PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
>@@ -2340,6 +2341,8 @@ install: all
> 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
>	$(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
>+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)'
>+	$(INSTALL) -m 644 gitconfig '$(DESTDIR_SQ)$(ETC_GITCONFIG_SQ)'
> ifndef NO_GETTEXT
> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'
> 	(cd po/build/locale && $(TAR) cf - .) | \
>diff --git a/gitconfig b/gitconfig
>new file mode 100644
>index 0000000..c45d300
>--- /dev/null
>+++ b/gitconfig
>@@ -0,0 +1,5 @@
>+[alias]
>+	co = checkout
>+	ci = commit
>+	rb = rebase
>+	st = status


-- 
David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-21 11:47 [PATCH v2] build: add default configuration Felipe Contreras
  2013-09-21 17:50 ` David Aguilar
@ 2013-09-21 18:58 ` Johannes Sixt
  2013-09-21 19:02   ` Felipe Contreras
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Sixt @ 2013-09-21 18:58 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: git, David Aguilar

Am 21.09.2013 13:47, schrieb Felipe Contreras:
> diff --git a/Makefile b/Makefile
> index 3588ca1..18081bf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1010,7 +1010,7 @@ ifndef sysconfdir
>  ifeq ($(prefix),/usr)
>  sysconfdir = /etc
>  else
> -sysconfdir = etc
> +sysconfdir = $(prefix)/etc

Not good: There is a reason why this is a relative path. Please dig the
history, it's pretty clear.

-- Hannes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-21 18:58 ` Johannes Sixt
@ 2013-09-21 19:02   ` Felipe Contreras
  2013-09-22  5:19     ` David Aguilar
  0 siblings, 1 reply; 7+ messages in thread
From: Felipe Contreras @ 2013-09-21 19:02 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git, David Aguilar

On Sat, Sep 21, 2013 at 1:58 PM, Johannes Sixt <j6t@kdbg.org> wrote:
> Am 21.09.2013 13:47, schrieb Felipe Contreras:
>> diff --git a/Makefile b/Makefile
>> index 3588ca1..18081bf 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1010,7 +1010,7 @@ ifndef sysconfdir
>>  ifeq ($(prefix),/usr)
>>  sysconfdir = /etc
>>  else
>> -sysconfdir = etc
>> +sysconfdir = $(prefix)/etc
>
> Not good: There is a reason why this is a relative path. Please dig the
> history, it's pretty clear.

It's pretty clear it's *not* a relative path.

What is relative about 'sysconfdir = /etc'?

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-21 19:02   ` Felipe Contreras
@ 2013-09-22  5:19     ` David Aguilar
  2013-09-22  5:34       ` Felipe Contreras
  0 siblings, 1 reply; 7+ messages in thread
From: David Aguilar @ 2013-09-22  5:19 UTC (permalink / raw)
  To: Felipe Contreras, Johannes Sixt; +Cc: git

Felipe Contreras <felipe.contreras@gmail.com> wrote:
>On Sat, Sep 21, 2013 at 1:58 PM, Johannes Sixt <j6t@kdbg.org> wrote:
>> Am 21.09.2013 13:47, schrieb Felipe Contreras:
>>> diff --git a/Makefile b/Makefile
>>> index 3588ca1..18081bf 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1010,7 +1010,7 @@ ifndef sysconfdir
>>>  ifeq ($(prefix),/usr)
>>>  sysconfdir = /etc
>>>  else
>>> -sysconfdir = etc
>>> +sysconfdir = $(prefix)/etc
>>
>> Not good: There is a reason why this is a relative path. Please dig
>the
>> history, it's pretty clear.
>
>It's pretty clear it's *not* a relative path.
>
>What is relative about 'sysconfdir = /etc'?

Thanks Johannes. Felipe, the history and this comment from the makefile should shed some light on it:

# Among the variables below, these:
#   gitexecdir
#   template_dir
#   sysconfdir
# can be specified as a relative path some/where/else;
# this is interpreted as relative to $(prefix) and "git" at
# runtime figures out where they are based on the path to the executable.
...
So it'll probably need another makefile variable to do this cleanly.

I hope that helps.
Cheers,


-- 
David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-22  5:19     ` David Aguilar
@ 2013-09-22  5:34       ` Felipe Contreras
  2013-09-22  8:52         ` David Aguilar
  0 siblings, 1 reply; 7+ messages in thread
From: Felipe Contreras @ 2013-09-22  5:34 UTC (permalink / raw)
  To: David Aguilar, Felipe Contreras, Johannes Sixt; +Cc: git

David Aguilar wrote:
> Felipe Contreras <felipe.contreras@gmail.com> wrote:
> >On Sat, Sep 21, 2013 at 1:58 PM, Johannes Sixt <j6t@kdbg.org> wrote:
> >> Am 21.09.2013 13:47, schrieb Felipe Contreras:
> >>> diff --git a/Makefile b/Makefile
> >>> index 3588ca1..18081bf 100644
> >>> --- a/Makefile
> >>> +++ b/Makefile
> >>> @@ -1010,7 +1010,7 @@ ifndef sysconfdir
> >>>  ifeq ($(prefix),/usr)
> >>>  sysconfdir = /etc
> >>>  else
> >>> -sysconfdir = etc
> >>> +sysconfdir = $(prefix)/etc
> >>
> >> Not good: There is a reason why this is a relative path. Please dig
> >the
> >> history, it's pretty clear.
> >
> >It's pretty clear it's *not* a relative path.
> >
> >What is relative about 'sysconfdir = /etc'?
> 
> Thanks Johannes. Felipe, the history and this comment from the makefile should shed some light on it:
> 
> # Among the variables below, these:
> #   gitexecdir
> #   template_dir
> #   sysconfdir
> # can be specified as a relative path some/where/else;
> # this is interpreted as relative to $(prefix) and "git" at
> # runtime figures out where they are based on the path to the executable.

They *can* be, but not necessarily so, and in particular sysconfig for probably
99% of the users is not relative, it's /etc.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] build: add default configuration
  2013-09-22  5:34       ` Felipe Contreras
@ 2013-09-22  8:52         ` David Aguilar
  0 siblings, 0 replies; 7+ messages in thread
From: David Aguilar @ 2013-09-22  8:52 UTC (permalink / raw)
  To: Felipe Contreras, Johannes Sixt; +Cc: git

Felipe Contreras <felipe.contreras@gmail.com> wrote:
>David Aguilar wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> wrote:
>> >On Sat, Sep 21, 2013 at 1:58 PM, Johannes Sixt <j6t@kdbg.org> wrote:
>> >> Am 21.09.2013 13:47, schrieb Felipe Contreras:
>> >>> diff --git a/Makefile b/Makefile
>> >>> index 3588ca1..18081bf 100644
>> >>> --- a/Makefile
>> >>> +++ b/Makefile
>> >>> @@ -1010,7 +1010,7 @@ ifndef sysconfdir
>> >>>  ifeq ($(prefix),/usr)
>> >>>  sysconfdir = /etc
>> >>>  else
>> >>> -sysconfdir = etc
>> >>> +sysconfdir = $(prefix)/etc
>> >>
>> >> Not good: There is a reason why this is a relative path. Please
>dig
>> >the
>> >> history, it's pretty clear.
>> >
>> >It's pretty clear it's *not* a relative path.
>> >
>> >What is relative about 'sysconfdir = /etc'?
>> 
>> Thanks Johannes. Felipe, the history and this comment from the
>makefile should shed some light on it:
>> 
>> # Among the variables below, these:
>> #   gitexecdir
>> #   template_dir
>> #   sysconfdir
>> # can be specified as a relative path some/where/else;
>> # this is interpreted as relative to $(prefix) and "git" at
>> # runtime figures out where they are based on the path to the
>executable.
>
>They *can* be, but not necessarily so, and in particular sysconfig for
>probably
>99% of the users is not relative, it's /etc.

This makes Git relocatable. MsysGit has many more users then developers, and represents a pretty large chunk of users. 

-- 
David

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-22  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-21 11:47 [PATCH v2] build: add default configuration Felipe Contreras
2013-09-21 17:50 ` David Aguilar
2013-09-21 18:58 ` Johannes Sixt
2013-09-21 19:02   ` Felipe Contreras
2013-09-22  5:19     ` David Aguilar
2013-09-22  5:34       ` Felipe Contreras
2013-09-22  8:52         ` David Aguilar

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).