git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alex Riesen <alexander.riesen@cetitec.com>
To: Stefan Beller <sbeller@google.com>
Cc: Paul Mackerras <paulus@ozlabs.org>,
	Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/2] gitk: show part of submodule log instead of empty pane when listing trees
Date: Wed, 9 May 2018 11:01:34 +0200	[thread overview]
Message-ID: <20180509090134.ozikiizgltfiusp5@pflmari> (raw)
In-Reply-To: <CAGZ79kYxZ43kJwS_odhNwCO2e_n-8JLNynAZj0+Hp3ugzYbqUg@mail.gmail.com>

Stefan Beller, Tue, May 08, 2018 19:07:29 +0200:
> On Tue, May 8, 2018 at 5:22 AM, Alex Riesen
> <alexander.riesen@cetitec.com> wrote:
> > Currently, the submodules either are not shown at all (if listing a
> > committed tree) or a Tcl error appears (when clicking on a submodule
> > from the index list).
> 
> I do not understand where this appears, yet.
> Where do I have to click to see the effects of this patch?

Er. I meant to say the file list panel (bottom right panel). Sorry,
didn't come out clear. I'll reword the commit message next time.

> > @@ -7659,21 +7660,42 @@ proc showfile {f} {
> >      global ctext_file_names ctext_file_lines
> >      global ctext commentend
> >
> > +    set submodlog "git\\ log\\ --format='%h\\ %aN:\\ %s'\\ -100"
> 
> Do we want to respect the config option diff.submodule here?

Probably not. It is already done when the file list panel is in "Patch" mode.
The "Tree" mode of the panel shows the files in full, so the submodules should
be shown similarly: in a format resembling their full (referenced) contents.

> The -100 is chosen rather arbitrarily. Ideally we'd only walk to the
> previous entry?

Yes, the limit is indeed arbitrary. I'm reluctant of listing full history,
though: it might take too long a while (and does, in my line of work). Maybe
an option in the settings? Or some kind of a more natural limit (for 1 second?
Until the end of panel?)

> > -       if {[catch {set bf [open $f r]} err]} {
> > -           puts "oops, can't read $f: $err"
> > -           return
> > +       if {[file isdirectory $f]} {
> > +           # a submodule
> > +           if {[catch {set bf [open "| sh -c cd\\ \"$f\"&&$submodlog" r]} err]} {
> 
> Can we have $submodlog use the "git -C <path> command"
> option, then we could save the "cd &&" part, which might even
> save us from spawning a shell?

That's because I forgot about that option. Of course, I'll fix this.
Also need a shellquote for the path.

Thanks!
Alex

---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus


  reply	other threads:[~2018-05-09  9:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 12:11 [PATCH 0/2] gitk: improve handling of submodules in the file list panel Alex Riesen
2018-05-08 12:22 ` [PATCH 1/2] gitk: show part of submodule log instead of empty pane when listing trees Alex Riesen
2018-05-08 17:07   ` Stefan Beller
2018-05-09  9:01     ` Alex Riesen [this message]
2018-05-08 12:22 ` [PATCH 2/2] gitk: add an option to run gitk on an item in the file list Alex Riesen
2018-05-08 13:17   ` Bert Wesarg
2018-05-08 13:39     ` Alex Riesen
2018-05-09  7:19       ` Bert Wesarg
2018-05-09 10:59         ` [PATCH] gitk: do not limit tree mode listing in the file list panel to current sub-directory Alex Riesen
2018-05-09 12:08           ` Bert Wesarg
2018-05-09 12:14             ` Alex Riesen
2018-05-09 12:35 ` [PATCH v2 0/2] gitk: improve handling of submodules in the file list panel Alex Riesen
2018-05-09 12:35   ` [PATCH v2 1/2] gitk: show part of submodule log instead of empty pane when listing trees Alex Riesen
2018-05-09 12:35   ` [PATCH v2 2/2] gitk: add an option to run gitk on an item in the file list Alex Riesen
2018-05-09 18:52   ` [PATCH v2 0/2] gitk: improve handling of submodules in the file list panel Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180509090134.ozikiizgltfiusp5@pflmari \
    --to=alexander.riesen@cetitec.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paulus@ozlabs.org \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).