Am 11.01.20 um 02:18 schrieb Joseph Myers:
I encourage people to continue to work on improving the documentation for
using git with GCC
(<https://gcc.gnu.org/ml/gcc-patches/2020-01/msg00623.html> and
<https://gcc.gnu.org/ml/gcc-patches/2020-01/msg00625.html> list some of
the things that it seems it might be useful to document). Once the
conversion is done we'll need to update various places referring to SVN on
the website and in the manuals.
Hi, some random notes:
In order to set user.name and user.email, the doc is using --global. At
least for me, the latter is not what I want because I am using git in
other contexts than contributing to GCC (and am using different e-mail
then).
In my git setup there is the following which I found quite useful when
changing .md, or more specifically diff'ing md's and having them reviewed.
diff files allow to indicate what has been changed, for example when you
changed some function, in the respective hunk the function name is
displayed. We can achieve the same for define_insn and similar:
In .gitconfig:
[diff "md"]
# .git/info/attributes maps *.md to diff=md
# You can also use .gitattributes for this
xfuncname = "^[ \t]*\\([ \t]*define_.*$"
This defines the hunk to match define_insn, define_expand etc. The
mapping can be performed in the files mentioned above and will read:
# Allow for custom diff hunks in your (global) .gitconfig
# e.g. for machine descriptions the respective entry could read
#
# [diff "md"]
# # GCC/.gitattributes maps *.md to diff=md
# xfuncname = "^[ \t]*\\([ \t]*define_.*$"
# GCC machine description
*.md diff=md
I am not planning to propose respective changes, so if you find it
helpful, maybe some maintainer can add it.
To see the difference, try
$ git show ec9b602c167fb7dfba717
for example. In the case it's regarded as helpful, maybe it can added
where it applies to all branches, not only to one specific branch.
(Dunno what changing .git/info, .git/config actually does, presumably it
only applies if the repo is cloned).
Sometimes, one wants a different editor for commit and merge messages
than the default one (dunno which one this is, presumably determined by
some env variable).
The respective entry in .gitconfig is:
[core]
editor = my-editor
or can be achieved by
git config [--global] core.editor="...". In my case, it's a script that
gets diffs from ChangeLog deltas and composes them to a commit message
and then calls my preferred editor on that.
And a question wrt e-mail addresses: I have 2 addresses associated with
my GCC contributions: one @gcc.gnu.org from my GCC account and one
non-gnu as mentioned in MAINTAINERS. Which one should I use for commits?
As far as I remember, the gnu address can cause some problems, but I
don't remember where...
Johann