Skip to content

Commit ab6b50e

Browse files
committed
* https://github.com/prati0100/git-gui: git-gui: improve Japanese translation git-gui: add a readme git-gui: support for diff3 conflict style git-gui: use existing interface to query a path's attribute git-gui (Windows): use git-bash.exe if it is available treewide: correct several "up-to-date" to "up to date" Fix build with core.autocrlf=true
2 parents 93bf742 + b524f6b commit ab6b50e

File tree

4 files changed

+210
-21
lines changed

4 files changed

+210
-21
lines changed

git-gui/README.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Git GUI - A graphical user interface for Git
2+
3+
Git GUI allows you to use the [Git source control management
4+
tools](https://git-scm.com/) via a GUI. This includes staging, committing,
5+
adding, pushing, etc. It can also be used as a blame viewer, a tree browser,
6+
and a citool (make exactly one commit before exiting and returning to shell).
7+
More details about Git GUI can be found in its manual page by either running
8+
`man git-gui`, or by visiting the [online manual
9+
page](https://git-scm.com/docs/git-gui).
10+
11+
Git GUI was initially written by Shawn O. Pearce, and is distributed with the
12+
standard Git installation.
13+
14+
# Building and installing
15+
16+
You need to have the following dependencies installed before you begin:
17+
18+
- Git
19+
- Tcl
20+
- Tk
21+
- wish
22+
- Gitk (needed for browsing history)
23+
- msgfmt
24+
25+
Most of Git GUI is written in Tcl, so there is no compilation involved. Still,
26+
some things do need to be done (mostly some substitutions), so you do need to
27+
"build" it.
28+
29+
You can build Git GUI using:
30+
31+
```
32+
make
33+
```
34+
35+
And then install it using:
36+
37+
```
38+
make install
39+
```
40+
41+
You probably need to have root/admin permissions to install.
42+
43+
# Contributing
44+
45+
The project is currently maintained by Pratyush Yadav over at
46+
https://github.com/prati0100/git-gui. Even though the project is hosted at
47+
GitHub, the development does not happen over GitHub Issues and Pull Requests.
48+
Instead, an email based workflow is used. The Git mailing list
49+
[[email protected]](mailto:[email protected]) is where the patches are
50+
discussed and reviewed.
51+
52+
More information about the Git mailing list and instructions to subscribe can
53+
be found [here](https://git.wiki.kernel.org/index.php/GitCommunity).
54+
55+
## Sending your changes
56+
57+
Since the development happens over email, you need to send in your commits in
58+
text format. Commits can be converted to emails via the two tools provided by
59+
Git: `git-send-email` and `git-format-patch`.
60+
61+
You can use `git-format-patch` to generate patches in mbox format from your
62+
commits that can then be sent via email. Let's say you are working on a branch
63+
called 'foo' that was created on top of 'master'. You can run:
64+
65+
```
66+
git format-patch -o output_dir master..foo
67+
```
68+
69+
to convert all the extra commits in 'foo' into a set of patches saved in the
70+
folder `output_dir`.
71+
72+
If you are sending multiple patches, it is recommended to include a cover
73+
letter. A cover letter is an email explaining in brief what the series is
74+
supposed to do. A cover letter template can be generated by passing
75+
`--cover-letter` to `git-format-patch`.
76+
77+
After you send your patches, you might get a review suggesting some changes.
78+
Make those changes, and re-send your patch(es) in reply to the first patch of
79+
your initial version. Also please mention the version of the patch. This can be
80+
done by passing `-v X` to `git-format-patch`, where 'X' is the version number
81+
of the patch(es).
82+
83+
### Using git-send-email
84+
85+
You can use `git-send-email` to send patches generated via `git-format-patch`.
86+
While you can directly send patches via `git-send-email`, it is recommended
87+
that you first use `git-format-patch` to generate the emails, audit them, and
88+
then send them via `git-send-email`.
89+
90+
A pretty good guide to configuring and using `git-send-email` can be found
91+
[here](https://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/)
92+
93+
### Using your email client
94+
95+
If your email client supports sending mbox format emails, you can use
96+
`git-format-patch` to get an mbox file for each commit, and then send them. If
97+
there is more than one patch in the series, then all patches after the first
98+
patch (or the cover letter) need to be sent as replies to the first.
99+
`git-send-email` does this by default.
100+
101+
### Using GitGitGadget
102+
103+
Since some people prefer a GitHub pull request based workflow, they can use
104+
[GitGitGadget](https://gitgitgadget.github.io/) to send in patches. The tool
105+
was originally written for sending patches to the Git project, but it now also
106+
supports sending patches for git-gui.
107+
108+
Instructions for using GitGitGadget to send git-gui patches, courtesy of
109+
Johannes Schindelin:
110+
111+
If you don't already have a fork of the [git/git](https://github.com/git/git)
112+
repo, you need to make one. Then clone your fork:
113+
114+
```
115+
git clone https://github.com/<your-username>/git
116+
```
117+
118+
Then add GitGitGadget as a remote:
119+
120+
```
121+
git remote add gitgitgadget https://github.com/gitgitgadget/git
122+
```
123+
124+
Then fetch the git-gui branch:
125+
126+
```
127+
git fetch gitgitgadget git-gui/master
128+
```
129+
130+
Then create a new branch based on git-gui/master:
131+
132+
```
133+
git checkout -b <your-branch-name> git-gui/master
134+
```
135+
136+
Make whatever commits you need to, push them to your fork, and then head over
137+
to https://github.com/gitgitgadget/git/pulls and open a Pull Request targeting
138+
git-gui/master.
139+
140+
GitGitGadget will welcome you with a (hopefully) helpful message.
141+
142+
## Signing off
143+
144+
You need to sign off your commits before sending them to the list. You can do
145+
that by passing the `-s` option to `git-commit`. You can also use the "Sign
146+
Off" option in Git GUI.
147+
148+
A sign-off is a simple 'Signed-off-by: A U Thor \<[email protected]\>' line at
149+
the end of the commit message, after your explanation of the commit.
150+
151+
A sign-off means that you are legally allowed to send the code, and it serves
152+
as a certificate of origin. More information can be found at
153+
[developercertificate.org](https://developercertificate.org/).
154+
155+
## Responding to review comments
156+
157+
It is quite likely your patches will get review comments. Those comments are
158+
sent on the Git mailing list as replies to your patch, and you will usually be
159+
Cc'ed in those replies.
160+
161+
You are expected to respond by either explaining your code further to convince
162+
the reviewer what you are doing is correct, or acknowledge the comments and
163+
re-send the patches with those comments addressed.
164+
165+
Some tips for those not familiar with communication on a mailing list:
166+
167+
- Use only plain text emails. No HTML at all.
168+
- Wrap lines at around 75 characters.
169+
- Do not send attachments. If you do need to send some files, consider using a
170+
hosting service, and paste the link in your email.
171+
- Do not [top post](http://www.idallen.com/topposting.html).
172+
- Always "reply all". Keep all correspondents and the list in Cc. If you reply
173+
directly to a reviewer, and not Cc the list, other people would not be able
174+
to chime in.

git-gui/git-gui.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,10 +2736,18 @@ if {![is_bare]} {
27362736
}
27372737
27382738
if {[is_Windows]} {
2739+
# Use /git-bash.exe if available
2740+
set normalized [file normalize $::argv0]
2741+
regsub "/mingw../libexec/git-core/git-gui$" \
2742+
$normalized "/git-bash.exe" cmdLine
2743+
if {$cmdLine != $normalized && [file exists $cmdLine]} {
2744+
set cmdLine [list "Git Bash" $cmdLine &]
2745+
} else {
2746+
set cmdLine [list "Git Bash" bash --login -l &]
2747+
}
27392748
.mbar.repository add command \
27402749
-label [mc "Git Bash"] \
2741-
-command {eval exec [auto_execok start] \
2742-
[list "Git Bash" bash --login -l &]}
2750+
-command {eval exec [auto_execok start] $cmdLine}
27432751
}
27442752
27452753
if {[is_Windows] || ![is_bare]} {
@@ -3581,6 +3589,9 @@ $ui_diff tag conf d_s- \
35813589
$ui_diff tag conf d< \
35823590
-foreground orange \
35833591
-font font_diffbold
3592+
$ui_diff tag conf d| \
3593+
-foreground orange \
3594+
-font font_diffbold
35843595
$ui_diff tag conf d= \
35853596
-foreground orange \
35863597
-font font_diffbold

git-gui/lib/diff.tcl

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,6 @@ proc show_other_diff {path w m cont_info} {
270270
}
271271
}
272272

273-
proc get_conflict_marker_size {path} {
274-
set size 7
275-
catch {
276-
set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]]
277-
set ret [gets $fd_rc line]
278-
close $fd_rc
279-
if {$ret > 0} {
280-
regexp {.*: conflict-marker-size: (\d+)$} $line line size
281-
}
282-
}
283-
return $size
284-
}
285-
286273
proc start_show_diff {cont_info {add_opts {}}} {
287274
global file_states file_lists
288275
global is_3way_diff is_submodule_diff diff_active repo_config
@@ -298,7 +285,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
298285
set is_submodule_diff 0
299286
set diff_active 1
300287
set current_diff_header {}
301-
set conflict_size [get_conflict_marker_size $path]
288+
set conflict_size [gitattr $path conflict-marker-size 7]
302289

303290
set cmd [list]
304291
if {$w eq $ui_index} {
@@ -360,6 +347,10 @@ proc start_show_diff {cont_info {add_opts {}}} {
360347
}
361348

362349
set ::current_diff_inheader 1
350+
# Detect pre-image lines of the diff3 conflict-style. They are just
351+
# '++' lines which is not bijective. Thus, we need to maintain a state
352+
# across lines.
353+
set ::conflict_in_pre_image 0
363354
fconfigure $fd \
364355
-blocking 0 \
365356
-encoding [get_path_encoding $path] \
@@ -462,11 +453,23 @@ proc read_diff {fd conflict_size cont_info} {
462453
{--} {set tags d_--}
463454
{++} {
464455
set regexp [string map [list %conflict_size $conflict_size]\
465-
{^\+\+([<>=]){%conflict_size}(?: |$)}]
456+
{^\+\+([<>=|]){%conflict_size}(?: |$)}]
466457
if {[regexp $regexp $line _g op]} {
467458
set is_conflict_diff 1
468459
set line [string replace $line 0 1 { }]
469460
set tags d$op
461+
462+
# The ||| conflict-marker marks the start of the pre-image.
463+
# All those lines are also prefixed with '++'. Thus we need
464+
# to maintain this state.
465+
set ::conflict_in_pre_image [expr {$op eq {|}}]
466+
} elseif {$::conflict_in_pre_image} {
467+
# This is a pre-image line. It is the one which both sides
468+
# are based on. As it has also the '++' line start, it is
469+
# normally shown as 'added'. Invert this to '--' to make
470+
# it a 'removed' line.
471+
set line [string replace $line 0 1 {--}]
472+
set tags d_--
470473
} else {
471474
set tags d_++
472475
}

git-gui/po/ja.po

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
#
55
# しらいし ななこ <[email protected]>, 2007.
66
# Satoshi Yasushima <[email protected]>, 2016.
7+
# KIDANI Akito <[email protected]>, 2019.
78
#
89
msgid ""
910
msgstr ""
1011
"Project-Id-Version: git-gui\n"
1112
"Report-Msgid-Bugs-To: \n"
1213
"POT-Creation-Date: 2016-05-27 17:52+0900\n"
13-
"PO-Revision-Date: 2016-06-22 12:50+0900\n"
14-
"Last-Translator: Satoshi Yasushima <s.yasushima@gmail.com>\n"
14+
"PO-Revision-Date: 2019-10-13 23:20+0900\n"
15+
"Last-Translator: KIDANI Akito <a.kid.1985@gmail.com>\n"
1516
"Language-Team: Japanese\n"
1617
"Language: ja\n"
1718
"MIME-Version: 1.0\n"
@@ -661,7 +662,7 @@ msgstr ""
661662
#: lib/merge.tcl:108
662663
#, tcl-format
663664
msgid "%s of %s"
664-
msgstr "%s の %s ブランチ"
665+
msgstr "%2$s の %1$s ブランチ"
665666

666667
#: lib/merge.tcl:122
667668
#, tcl-format
@@ -956,7 +957,7 @@ msgstr "エラー: コマンドが失敗しました"
956957
#: lib/checkout_op.tcl:85
957958
#, tcl-format
958959
msgid "Fetching %s from %s"
959-
msgstr "%s から %s をフェッチしています"
960+
msgstr "%2$s から %1$s をフェッチしています"
960961

961962
#: lib/checkout_op.tcl:133
962963
#, tcl-format

0 commit comments

Comments
 (0)