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

Re: git rm bug

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Jun 6, 2018, 20:20 UTC
Message-ID
<alpine.LFD.2.21.1806061609440.10418@localhost.localdomain>
In-Reply-To
<20180606201012.GA2454@sleipnir>
On Thu, 7 Jun 2018, Timothy Rice wrote:
Show 13 quoted lines
> > It does seem like something which could be noted in the git
> > rm docs.  Perhaps you'd care to take a stab at a patch to
> > add a note to Documentation/git-rm.txt Thomas?  Maybe a note
> > at the end of the DISCUSSION section?
>
> That same documentation could mention a common workaround for when
> someone does really want to keep the empty directories:
>
> $ touch ./path/to/empty/dir/.keep
> $ git add ./path/to/empty/dir/.keep
> $ git commit -m "Keep that empty directory because it is needed for <whatever>"
>
> This would obviate the need for a new flag to switch behaviours.
  i'm going to be contrarian and obstinate and suggest that the
current behaviour is fine, since there is no compelling rationale for
any *other* behaviour.
  invariably, every defense for hanging on to empty directories boils
down to, "i might do something in the future that expects those
directories to exist." well, if that's the case, then create them when
you need them -- nothing you do should ever simply *assume* the
existence of essential directories.
  in addition, by "untracking" those directories, you're suggesting
that git quietly do what should normally be done by "git rm --cached".
if i want that behaviour, i would prefer to have to type it myself.
  i'm fine with just adding a note to "git rm" making it clear what
happens in this case. i see no value in supporting extra options that
simply encourage bad behaviour.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Timothy RiceNext: Ævar Arnfjörð Bjarmason
Message 8 of 11 in “git rm bug”
  1. Thomas FischerJun 6, 2018
  2. Robert P. J. DayJun 6, 2018
  3. Thomas FischerJun 6, 2018
  4. Robert P. J. DayJun 6, 2018
  5. Todd ZullingerJun 6, 2018
  6. Jeff KingJun 6, 2018
  7. Timothy RiceJun 6, 2018
  8. Robert P. J. DayJun 6, 2018
  9. Ævar Arnfjörð BjarmasonJun 6, 2018
  10. Ævar Arnfjörð BjarmasonJun 6, 2018
  11. Duy NguyenJun 6, 2018

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.