diff mbox series

[3/3] gitk: set log.graph=false when running `git log`

Message ID 20220209162350.169971-3-alexhenrie24@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/3] log: fix memory leak if --graph is passed multiple times | expand

Commit Message

Alex Henrie Feb. 9, 2022, 4:23 p.m. UTC
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 gitk-git/gitk | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Junio C Hamano Feb. 9, 2022, 6:26 p.m. UTC | #1
Alex Henrie <alexhenrie24@gmail.com> writes:

> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
>  gitk-git/gitk | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

This may handle "gitk", but what about thousands other scripts
people have developed around "git log", I have to wonder.



> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index 23d9dd1fe0..1d8a5ff622 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -411,8 +411,9 @@ proc start_rev_list {view} {
>      }
>  
>      if {[catch {
> -        set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
> -                        --parents --boundary $args "--" $files] r]
> +        set fd [open [concat | git -c log.graph=false log --no-color -z \
> +                        --pretty=raw $show_notes --parents --boundary $args \
> +                        "--" $files] r]
>      } err]} {
>          error_popup "[mc "Error executing git log:"] $err"
>          return 0
> @@ -559,8 +560,9 @@ proc updatecommits {} {
>          set args $vorigargs($view)
>      }
>      if {[catch {
> -        set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
> -                        --parents --boundary $args "--" $vfilelimit($view)] r]
> +        set fd [open [concat | git -c log.graph=false log --no-color -z \
> +                        --pretty=raw $show_notes --parents --boundary $args \
> +                        "--" $vfilelimit($view)] r]
>      } err]} {
>          error_popup "[mc "Error executing git log:"] $err"
>          return
Alex Henrie Feb. 10, 2022, 4:50 p.m. UTC | #2
On Wed, Feb 9, 2022 at 11:26 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> This may handle "gitk", but what about thousands other scripts
> people have developed around "git log", I have to wonder.

That's true, but every new preference carries that risk, and there's
not much we can do about it. Users who set log.graph=true will just
have to accept that it won't be compatible with every tool in the
wild.

-Alex
Junio C Hamano Feb. 10, 2022, 8:15 p.m. UTC | #3
Alex Henrie <alexhenrie24@gmail.com> writes:

> On Wed, Feb 9, 2022 at 11:26 AM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> This may handle "gitk", but what about thousands other scripts
>> people have developed around "git log", I have to wonder.
>
> That's true, but every new preference carries that risk, and there's
> not much we can do about it. Users who set log.graph=true will just
> have to accept that it won't be compatible with every tool in the
> wild.

I wouldn't call something that is known to break people before it is
released to the wild a "risk", though.
diff mbox series

Patch

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 23d9dd1fe0..1d8a5ff622 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -411,8 +411,9 @@  proc start_rev_list {view} {
     }
 
     if {[catch {
-        set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
-                        --parents --boundary $args "--" $files] r]
+        set fd [open [concat | git -c log.graph=false log --no-color -z \
+                        --pretty=raw $show_notes --parents --boundary $args \
+                        "--" $files] r]
     } err]} {
         error_popup "[mc "Error executing git log:"] $err"
         return 0
@@ -559,8 +560,9 @@  proc updatecommits {} {
         set args $vorigargs($view)
     }
     if {[catch {
-        set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
-                        --parents --boundary $args "--" $vfilelimit($view)] r]
+        set fd [open [concat | git -c log.graph=false log --no-color -z \
+                        --pretty=raw $show_notes --parents --boundary $args \
+                        "--" $vfilelimit($view)] r]
     } err]} {
         error_popup "[mc "Error executing git log:"] $err"
         return