From b71c6c3b64bc002731bc2d6c49080a4855d2c169 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 9 May 2017 14:53:21 +0200 Subject: Fix build with core.autocrlf=true On Windows, the default line endings are denoted by a Carriage Return byte followed by a Line Feed byte, while Linux and MacOSX use a single Line Feed byte to denote a line ending. To help with this situation, Git introduced several mechanisms over the last decade, most prominently the `core.autocrlf` setting. Sometimes, however, a single setting is incorrect, e.g. when certain files in the source code are to be consumed by software that can handle only LF line endings, while other files can use whatever is appropriate for the current platform. To allow for that, Git added the `eol` option to its .gitattributes handling, expecting every user of Git to mark their source code appropriately. Bash assumes that line-endings of scripts are denoted by a single Line Feed byte. Therefore, shell scripts in Git's source code are one example where that `eol=lf` option is *required*. When generating common-cmds.h, the Unix tools we use generally operate on the assumption that input and output deliminate their lines using LF-only line endings. Consequently, they would happily copy the CR byte verbatim into the strings in common-cmds.h, which in turn makes the C preprocessor barf (that interprets them as MacOS-style line endings). Therefore, we have to mark the input files as LF-only: command-list.txt and Documentation/git-*.txt. Quite a bit belatedly, this patch brings Git's own source code in line with those expectations by setting those attributes to allow for a correct build even when core.autocrlf=true. This patch can be validated even on Linux, by using this cadence: git config core.autocrlf true rm .git/index && git stash make -j15 DEVELOPER=1 Signed-off-by: Johannes Schindelin Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano Signed-off-by: Pratyush Yadav diff --git a/.gitattributes b/.gitattributes index 33d07c0..59cd41d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ * encoding=US-ASCII git-gui.sh encoding=UTF-8 /po/*.po encoding=UTF-8 +/GIT-VERSION-GEN eol=lf -- cgit v0.10.2-6-g49f6 From faf420e05a96ff167f41161f3feebce4c31cf044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85gren?= Date: Wed, 23 Aug 2017 19:49:35 +0200 Subject: treewide: correct several "up-to-date" to "up to date" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow the Oxford style, which says to use "up-to-date" before the noun, but "up to date" after it. Don't change plumbing (specifically send-pack.c, but transport.c (git push) also has the same string). This was produced by grepping for "up-to-date" and "up to date". It turned out we only had to edit in one direction, removing the hyphens. Fix a typo in Documentation/git-diff-index.txt while we're there. Reported-by: Jeffrey Manian Reported-by: STEVEN WHITE Signed-off-by: Martin Ågren Signed-off-by: Junio C Hamano Signed-off-by: Pratyush Yadav diff --git a/po/README b/po/README index 0f5837d..2514bc2 100644 --- a/po/README +++ b/po/README @@ -165,7 +165,7 @@ to contribute an update. This may be because you would want to improve the translation of existing messages, or because the git-gui software itself was updated and there are new messages that need translation. -In any case, make sure you are up-to-date before starting your work: +In any case, make sure you are up to date before starting your work: $ git checkout master $ git pull -- cgit v0.10.2-6-g49f6 From 6a72d44fc274db71f9b7350a2977a27cf13ca550 Mon Sep 17 00:00:00 2001 From: Thomas Klaeger Date: Thu, 26 Sep 2019 10:46:19 -0700 Subject: git-gui (Windows): use git-bash.exe if it is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git for Windows 2.x ships with an executable that starts the Git Bash with all the environment variables and what not properly set up. It is also adjusted according to the Terminal emulator option chosen when installing Git for Windows (while `bash.exe --login -i` would always launch with Windows' default console). So let's use that executable (usually C:\Program Files\Git\git-bash.exe) instead of `bash.exe --login -i` if its presence was detected. This fixes https://github.com/git-for-windows/git/issues/490 Signed-off-by: Thomas Kläger Signed-off-by: Johannes Schindelin Signed-off-by: Pratyush Yadav diff --git a/git-gui.sh b/git-gui.sh index fd476b6..20b8afe 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2736,10 +2736,18 @@ if {![is_bare]} { } if {[is_Windows]} { + # Use /git-bash.exe if available + set normalized [file normalize $::argv0] + regsub "/mingw../libexec/git-core/git-gui$" \ + $normalized "/git-bash.exe" cmdLine + if {$cmdLine != $normalized && [file exists $cmdLine]} { + set cmdLine [list "Git Bash" $cmdLine &] + } else { + set cmdLine [list "Git Bash" bash --login -l &] + } .mbar.repository add command \ -label [mc "Git Bash"] \ - -command {eval exec [auto_execok start] \ - [list "Git Bash" bash --login -l &]} + -command {eval exec [auto_execok start] $cmdLine} } if {[is_Windows] || ![is_bare]} { -- cgit v0.10.2-6-g49f6 From c3b57dc2a0fe944b3c6c9c11b4ce0700c77f190c Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Mon, 30 Sep 2019 21:54:52 +0200 Subject: git-gui: use existing interface to query a path's attribute Replace the hand-coded call to git check-attr with the already provided one. Signed-off-by: Bert Wesarg Signed-off-by: Pratyush Yadav diff --git a/lib/diff.tcl b/lib/diff.tcl index 958a0fa..0fd4600 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -270,19 +270,6 @@ proc show_other_diff {path w m cont_info} { } } -proc get_conflict_marker_size {path} { - set size 7 - catch { - set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]] - set ret [gets $fd_rc line] - close $fd_rc - if {$ret > 0} { - regexp {.*: conflict-marker-size: (\d+)$} $line line size - } - } - return $size -} - proc start_show_diff {cont_info {add_opts {}}} { global file_states file_lists global is_3way_diff is_submodule_diff diff_active repo_config @@ -298,7 +285,7 @@ proc start_show_diff {cont_info {add_opts {}}} { set is_submodule_diff 0 set diff_active 1 set current_diff_header {} - set conflict_size [get_conflict_marker_size $path] + set conflict_size [gitattr $path conflict-marker-size 7] set cmd [list] if {$w eq $ui_index} { -- cgit v0.10.2-6-g49f6 From b436825b9bf3c606bb684e41f426fa3d0c088328 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Wed, 2 Oct 2019 09:36:02 +0200 Subject: git-gui: support for diff3 conflict style This adds highlight support for the diff3 conflict style. The common pre-image will be reversed to --, because it has been removed and replaced with ours or theirs side respectively. Signed-off-by: Bert Wesarg Signed-off-by: Pratyush Yadav diff --git a/git-gui.sh b/git-gui.sh index fd476b6..6d80f82 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -3581,6 +3581,9 @@ $ui_diff tag conf d_s- \ $ui_diff tag conf d< \ -foreground orange \ -font font_diffbold +$ui_diff tag conf d| \ + -foreground orange \ + -font font_diffbold $ui_diff tag conf d= \ -foreground orange \ -font font_diffbold diff --git a/lib/diff.tcl b/lib/diff.tcl index 0fd4600..871ad48 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -347,6 +347,10 @@ proc start_show_diff {cont_info {add_opts {}}} { } set ::current_diff_inheader 1 + # Detect pre-image lines of the diff3 conflict-style. They are just + # '++' lines which is not bijective. Thus, we need to maintain a state + # across lines. + set ::conflict_in_pre_image 0 fconfigure $fd \ -blocking 0 \ -encoding [get_path_encoding $path] \ @@ -449,11 +453,23 @@ proc read_diff {fd conflict_size cont_info} { {--} {set tags d_--} {++} { set regexp [string map [list %conflict_size $conflict_size]\ - {^\+\+([<>=]){%conflict_size}(?: |$)}] + {^\+\+([<>=|]){%conflict_size}(?: |$)}] if {[regexp $regexp $line _g op]} { set is_conflict_diff 1 set line [string replace $line 0 1 { }] set tags d$op + + # The ||| conflict-marker marks the start of the pre-image. + # All those lines are also prefixed with '++'. Thus we need + # to maintain this state. + set ::conflict_in_pre_image [expr {$op eq {|}}] + } elseif {$::conflict_in_pre_image} { + # This is a pre-image line. It is the one which both sides + # are based on. As it has also the '++' line start, it is + # normally shown as 'added'. Invert this to '--' to make + # it a 'removed' line. + set line [string replace $line 0 1 {--}] + set tags d_-- } else { set tags d_++ } -- cgit v0.10.2-6-g49f6 From 1e6880fd06bf6b3f440065dbecf73434c142eeb6 Mon Sep 17 00:00:00 2001 From: Pratyush Yadav Date: Sat, 5 Oct 2019 01:23:08 +0530 Subject: git-gui: add a readme It is a good idea to have a readme so people finding the project can know more about it, and know how they can get involved. Signed-off-by: Pratyush Yadav Acked-by: Bert Wesarg diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ce2122 --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +# Git GUI - A graphical user interface for Git + +Git GUI allows you to use the [Git source control management +tools](https://git-scm.com/) via a GUI. This includes staging, committing, +adding, pushing, etc. It can also be used as a blame viewer, a tree browser, +and a citool (make exactly one commit before exiting and returning to shell). +More details about Git GUI can be found in its manual page by either running +`man git-gui`, or by visiting the [online manual +page](https://git-scm.com/docs/git-gui). + +Git GUI was initially written by Shawn O. Pearce, and is distributed with the +standard Git installation. + +# Building and installing + +You need to have the following dependencies installed before you begin: + +- Git +- Tcl +- Tk +- wish +- Gitk (needed for browsing history) +- msgfmt + +Most of Git GUI is written in Tcl, so there is no compilation involved. Still, +some things do need to be done (mostly some substitutions), so you do need to +"build" it. + +You can build Git GUI using: + +``` +make +``` + +And then install it using: + +``` +make install +``` + +You probably need to have root/admin permissions to install. + +# Contributing + +The project is currently maintained by Pratyush Yadav over at +https://github.com/prati0100/git-gui. Even though the project is hosted at +GitHub, the development does not happen over GitHub Issues and Pull Requests. +Instead, an email based workflow is used. The Git mailing list +[git@vger.kernel.org](mailto:git@vger.kernel.org) is where the patches are +discussed and reviewed. + +More information about the Git mailing list and instructions to subscribe can +be found [here](https://git.wiki.kernel.org/index.php/GitCommunity). + +## Sending your changes + +Since the development happens over email, you need to send in your commits in +text format. Commits can be converted to emails via the two tools provided by +Git: `git-send-email` and `git-format-patch`. + +You can use `git-format-patch` to generate patches in mbox format from your +commits that can then be sent via email. Let's say you are working on a branch +called 'foo' that was created on top of 'master'. You can run: + +``` +git format-patch -o output_dir master..foo +``` + +to convert all the extra commits in 'foo' into a set of patches saved in the +folder `output_dir`. + +If you are sending multiple patches, it is recommended to include a cover +letter. A cover letter is an email explaining in brief what the series is +supposed to do. A cover letter template can be generated by passing +`--cover-letter` to `git-format-patch`. + +After you send your patches, you might get a review suggesting some changes. +Make those changes, and re-send your patch(es) in reply to the first patch of +your initial version. Also please mention the version of the patch. This can be +done by passing `-v X` to `git-format-patch`, where 'X' is the version number +of the patch(es). + +### Using git-send-email + +You can use `git-send-email` to send patches generated via `git-format-patch`. +While you can directly send patches via `git-send-email`, it is recommended +that you first use `git-format-patch` to generate the emails, audit them, and +then send them via `git-send-email`. + +A pretty good guide to configuring and using `git-send-email` can be found +[here](https://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/) + +### Using your email client + +If your email client supports sending mbox format emails, you can use +`git-format-patch` to get an mbox file for each commit, and then send them. If +there is more than one patch in the series, then all patches after the first +patch (or the cover letter) need to be sent as replies to the first. +`git-send-email` does this by default. + +### Using GitGitGadget + +Since some people prefer a GitHub pull request based workflow, they can use +[GitGitGadget](https://gitgitgadget.github.io/) to send in patches. The tool +was originally written for sending patches to the Git project, but it now also +supports sending patches for git-gui. + +Instructions for using GitGitGadget to send git-gui patches, courtesy of +Johannes Schindelin: + +If you don't already have a fork of the [git/git](https://github.com/git/git) +repo, you need to make one. Then clone your fork: + +``` +git clone https://github.com//git +``` + +Then add GitGitGadget as a remote: + +``` +git remote add gitgitgadget https://github.com/gitgitgadget/git +``` + +Then fetch the git-gui branch: + +``` +git fetch gitgitgadget git-gui/master +``` + +Then create a new branch based on git-gui/master: + +``` +git checkout -b git-gui/master +``` + +Make whatever commits you need to, push them to your fork, and then head over +to https://github.com/gitgitgadget/git/pulls and open a Pull Request targeting +git-gui/master. + +GitGitGadget will welcome you with a (hopefully) helpful message. + +## Signing off + +You need to sign off your commits before sending them to the list. You can do +that by passing the `-s` option to `git-commit`. You can also use the "Sign +Off" option in Git GUI. + +A sign-off is a simple 'Signed-off-by: A U Thor \' line at +the end of the commit message, after your explanation of the commit. + +A sign-off means that you are legally allowed to send the code, and it serves +as a certificate of origin. More information can be found at +[developercertificate.org](https://developercertificate.org/). + +## Responding to review comments + +It is quite likely your patches will get review comments. Those comments are +sent on the Git mailing list as replies to your patch, and you will usually be +Cc'ed in those replies. + +You are expected to respond by either explaining your code further to convince +the reviewer what you are doing is correct, or acknowledge the comments and +re-send the patches with those comments addressed. + +Some tips for those not familiar with communication on a mailing list: + +- Use only plain text emails. No HTML at all. +- Wrap lines at around 75 characters. +- Do not send attachments. If you do need to send some files, consider using a + hosting service, and paste the link in your email. +- Do not [top post](http://www.idallen.com/topposting.html). +- Always "reply all". Keep all correspondents and the list in Cc. If you reply + directly to a reviewer, and not Cc the list, other people would not be able + to chime in. -- cgit v0.10.2-6-g49f6 From f6f3824b4e5cb7699b62beef4ead665f67888346 Mon Sep 17 00:00:00 2001 From: kdnakt Date: Mon, 14 Oct 2019 01:31:38 +0000 Subject: git-gui: improve Japanese translation Signed-off-by: kdnakt Signed-off-by: Pratyush Yadav diff --git a/po/ja.po b/po/ja.po index 208651c..2f61153 100644 --- a/po/ja.po +++ b/po/ja.po @@ -4,14 +4,15 @@ # # しらいし ななこ , 2007. # Satoshi Yasushima , 2016. +# KIDANI Akito , 2019. # msgid "" msgstr "" "Project-Id-Version: git-gui\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-27 17:52+0900\n" -"PO-Revision-Date: 2016-06-22 12:50+0900\n" -"Last-Translator: Satoshi Yasushima \n" +"PO-Revision-Date: 2019-10-13 23:20+0900\n" +"Last-Translator: KIDANI Akito \n" "Language-Team: Japanese\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -661,7 +662,7 @@ msgstr "" #: lib/merge.tcl:108 #, tcl-format msgid "%s of %s" -msgstr "%s の %s ブランチ" +msgstr "%2$s の %1$s ブランチ" #: lib/merge.tcl:122 #, tcl-format @@ -956,7 +957,7 @@ msgstr "エラー: コマンドが失敗しました" #: lib/checkout_op.tcl:85 #, tcl-format msgid "Fetching %s from %s" -msgstr "%s から %s をフェッチしています" +msgstr "%2$s から %1$s をフェッチしています" #: lib/checkout_op.tcl:133 #, tcl-format -- cgit v0.10.2-6-g49f6