[GHC] #10989: :ctags and :etags command can receive haskell source files as a parameter
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: GHCi | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Documentation Unknown/Multiple | bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- A friend of mine accidentally lost a bunch of uncomited code because he passed the name of his source file to ghci's ctags command {{{ :ctags hisstuff.hs }}} He tought that the ctags parameter was the name of the file to create the ctags from. Instead, that parameter is actually for the name of the file to write the tags to. His Haskell source file was instantly overwritten by the tag info. The source of this confusion is that the the documentation from the `:help` command just says it takes a "file" parameter, without explicitly mentioning that its the name of the *output* file. {{{ :ctags[!] [<file>] create tags file for Vi (default: "tags") (!: use regex instead of line number) :etags [<file>] create tags file for Emacs (default: "TAGS") }}} I think it would be safer to use a more precise name here instead of `<file>`. Something like `<output>` or `<outputFile>`. It might also be a good idea to forbid the ctags and etags commands from overwriting existing "hs" and "lhs" source files. If a user types `:ctags something.hs` then its almost certainly a mistake with potentially destructive consequences. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer * milestone: => 8.0.1 Comment: This sounds like a nice task for a newcomer: * Update the documentation as mentioned. * Change the function `collateAndWriteTags` in `ghc/GhciTags.hs` to not overwrite existing source files. * Add one or multiple tests in `testsuite/tests/ghci/scripts/`, see [wiki:Building/RunningTests/Adding]. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by tvv): * owner: => tvv -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://phabricator.haskell.org/D1471 -------------------------------------+------------------------------------- Changes (by tvv): * differential: => https://phabricator.haskell.org/D1471 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1471 Wiki Page: | -------------------------------------+------------------------------------- Changes (by tvv): * differential: https://phabricator.haskell.org/D1471 => Phab:D1471 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: patch Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1471 Wiki Page: | -------------------------------------+------------------------------------- Changes (by tvv): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: upstream Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1471 Wiki Page: | -------------------------------------+------------------------------------- Changes (by tvv): * status: patch => upstream -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: upstream Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1471 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Austin Seipp <austin@…>): In [changeset:"a689c8edb1639669cb8df58092b8b77a0a581717/ghc" a689c8ed/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="a689c8edb1639669cb8df58092b8b77a0a581717" ghci: don't let ctags/etags overwrite source files A ource file which was accidently passed as parameter into `:ctags` or `:etags` can be overwritten by tag data. This patch updates documentation to avoid confusion in commands usage and prevents `collateAndWriteTags` from modifying existing source files. Reviewed By: thomie, bgamari, austin Differential Revision: https://phabricator.haskell.org/D1471 GHC Trac Issues: #10989 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10989: :ctags and :etags command can receive haskell source files as a parameter -------------------------------------+------------------------------------- Reporter: hugomg | Owner: tvv Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: GHCi | Version: 7.10.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1471 Wiki Page: | -------------------------------------+------------------------------------- Changes (by tvv): * status: upstream => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10989#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC