git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] git-latexdiff: new command in contrib, to use latexdiff and Git

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 16, 2012, 09:15 UTC
Message-ID
<m3hayrrvf9.fsf@localhost.localdomain>
In-Reply-To
<1329381560-15853-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 11 quoted lines
> +verbose "Auto-detecting PDF viewer"
> +for command in xdg-open evince okular xpdf acroread; do
> +    if [ "$PDFVIEWER" = "" ]; then
> +	if command -v "$command" >/dev/null 2>&1; then
> +	    PDFVIEWER="$command"
> +	else
> +	    verbose_progress
> +	fi
> +    fi
> +done
> +verbose_done "$PDFVIEWER"

Why we autodetect PDF viewer unconditionally? Why we do not stop on first detected viewer rather than last? Why not

  +if [ "$PDFVIEWER" = "" ]; then
  +	verbose "Auto-detecting PDF viewer"
  +	for command in xdg-open evince okular xpdf acroread; do
  +		if command -v "$command" >/dev/null 2>&1; then
  +			PDFVIEWER=$command
  +			break
  +		else
  +			verbose_progress
  +		fi
  +	done
  +	verbose_done "$PDFVIEWER"
  +fi
Nb. Documentation/CodingGuidelines says:
  For shell scripts specifically (not exhaustive):
  
  [...]
  
   - We prefer "test" over "[ ... ]".
I know that 'contrib/' is more relaxed...
-- 
Jakub Narebski
Previous: Matthieu MoyNext: David Aguilar
Message 5 of 22 in “git-latexdiff: new command in contrib, to use latexdiff and Git”
  1. git-latexdiff: new command in contrib, to use latexdiff and GitMatthieu Moy, Feb 15, 2012
  2. Tim HagaFeb 15, 2012
  3. Matthieu MoyFeb 16, 2012
  4. git-latexdiff: new command in contrib, to use latexdiff and GitMatthieu Moy, Feb 16, 2012
  5. Jakub NarebskiFeb 16, 2012
  6. David AguilarFeb 16, 2012
  7. Steven MichalskeFeb 16, 2012
  8. Matthieu MoyFeb 16, 2012
  9. git-latexdiff: new command in contrib, to use latexdiff and GitMatthieu Moy, Feb 16, 2012
  10. Jakub NarebskiFeb 16, 2012
  11. git-latexdiff: new command in contrib, to use latexdiff and GitMatthieu Moy, Feb 16, 2012
  12. Matthieu MoyFeb 16, 2012
  13. Junio C HamanoFeb 16, 2012
  14. Junio C HamanoFeb 16, 2012
  15. Matthieu MoyFeb 17, 2012
  16. Junio C HamanoFeb 17, 2012
  17. Matthieu MoyFeb 17, 2012
  18. Junio C HamanoFeb 17, 2012
  19. Jakub NarebskiFeb 17, 2012
  20. Matthieu MoyFeb 20, 2012
  21. Junio C HamanoFeb 20, 2012
  22. Matthieu MoyFeb 20, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.