All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anders Melchiorsen <mail@cup.kalibalik.dk>
To: git@vger.kernel.org
Subject: [BUG] git merge does not prune empty directories
Date: Wed, 24 Sep 2008 18:32:22 +0200	[thread overview]
Message-ID: <87k5d1v71l.fsf@cup.kalibalik.dk> (raw)

I got an empty directory left over today, and have reduced the problem
to this sequence. If I leave out the second add (so the merge is a
fast forward), the directory is removed as I would expect.

This is with Git 1.6.0.2.


    Anders



and@dylle:~$ mkdir repo ; cd repo
and@dylle:~/repo$ git init
Initialized empty Git repository in /home/and/repo/.git/
and@dylle:~/repo$ mkdir a ; date >a/b ; git add a/b ; git commit -m'Add 1'
Created initial commit 72194c7: Add 1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 a/b
and@dylle:~/repo$ git checkout -b other
Switched to a new branch "other"
and@dylle:~/repo$ git rm a/b ; git commit -m'Remove 1'
rm 'a/b'
Created commit 9c0282c: Remove 1
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 a/b
and@dylle:~/repo$ git checkout master
Switched to branch "master"
and@dylle:~/repo$ date >c ; git add c ; git commit -m'Add 2'
Created commit 39d60d4: Add 2
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 c
and@dylle:~/repo$ git merge other
Removed a/b
Merge made by recursive.
 a/b |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 a/b
and@dylle:~/repo$ rmdir a
and@dylle:~/repo$ rmdir a
rmdir: failed to remove `a': No such file or directory

             reply	other threads:[~2008-09-24 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 16:32 Anders Melchiorsen [this message]
2008-09-25 20:12 ` [PATCH] Remove empty directories in recursive merge Alex Riesen
2008-09-25 20:17   ` [PATCH] Cleanup remove_path Alex Riesen
2008-09-25 20:22     ` [PATCH] Fix memleak and the implementation of remove_file in builtin-rm.c Alex Riesen
2008-09-26 15:28       ` Shawn O. Pearce
2008-09-26 22:56         ` [PATCH] Add remove_path: a function to remove as much as possible of a path Alex Riesen
2008-09-26 22:59           ` [PATCH] Use remove_path from dir.c instead of own implementation Alex Riesen
2008-09-25 20:33   ` [PATCH] Remove empty directories in recursive merge Alex Riesen
2008-09-26 15:06     ` Shawn O. Pearce
2008-09-26  5:58   ` Johannes Sixt

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

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

  git send-email \
    --in-reply-to=87k5d1v71l.fsf@cup.kalibalik.dk \
    --to=mail@cup.kalibalik.dk \
    --cc=git@vger.kernel.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.