Re: [PATCH 2/2] gitk: add an option to run gitk on an item in the file list
- From
Alex Riesen <alexander.riesen@cetitec.com>
- Date
- May 8, 2018, 13:39 UTC
- Message-ID
- <20180508133905.6jhhhp6l7avjkctl@pflmari>
- In-Reply-To
- <CAKPyHN3YMU3oZaW-wR2ZMV6aMwoeFGMmiJBQXtvipVvkWPLZVQ@mail.gmail.com>
Bert Wesarg, Tue, May 08, 2018 15:17:03 +0200:
Show 9 quoted lines
> On Tue, May 8, 2018 at 2:22 PM, Alex Riesen <alexander.riesen@cetitec.com> wrote:
> > +proc flist_gitk {} {
> > + global flist_menu_file findstring gdttype
> > +
> > + set x [shellquote $flist_menu_file]
>
> this needs to handle cdup, i.e., if gitk is run from a subdirectory,
> all paths needs to be prefixed with $cdup, like: [file join $cdup
> $flist_menu_file]That, indeed, is easily done:
set x [shellquote [file join $cdup $flist_menu_file]]
if {[file isdirectory $flist_menu_file]} {
exec sh -c "cd $x&&gitk" &
} else {
exec gitk -- $x &
}It just doesn't seem to work: gitk does not find any commits! Maybe that's because the file panel lists only files for the current subdirectory (without the path from the repo top-level)? E.g.
mkdir tst
cd tst
git init
mkdir a
touch top-file a/sub-file
git add -A ; git commit -m.
cd a
gitkGitk lists only sub-file.
Frankly, this listing limited to just a sub-directory confuses me a bit. Is there anyway to get to display full repository without changing to the top level?
--- Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus