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

Re: getting rid of extra directories

From
ZBZack Brown <zbrown@tumblerings.org>
Date
Oct 15, 2005, 19:27 UTC
Message-ID
<20051015192720.GA11364@tumblerings.org>
In-Reply-To
<7vu0fimzhn.fsf@assigned-by-dhcp.cox.net>
On Sat, Oct 15, 2005 at 11:00:52AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> Zack Brown <zbrown@tumblerings.org> writes:
> 
> > I've been using the latest Cogito. When I seek back and forth in a git repo,
> > directories I've created tend to persist backward in time, cluttering up
> > earlier versions.
> >
> > By the discussions on this list, I'm pretty sure there's a way to stop this,
> > but I don't know clearly what it is, and I'm worried about trying things
> > that might corrupt my repository. Could someone spell it out for me please?
> 
> I do not know exactly what Cogito "seek back and forth" does,

It means to "cg-seek" back to an earlier state of the repo, and forward to a more recent state of the repo. "seeking back and forth" means doing a lot of "cg-seek" commands. Sorry that wasn't clear.

> but updating to git-core "master" branch may help.
I already use that branch.
Here's some commands that reproduce the problem:

$ mkdir tmpproj $ cd tmpproj $ cg-init

give the initial commit message and save

$ ls > a $ cg-add a $ cg-commit

give the commit message and save

$ cg-tag nodirs $ mkdir d $ mv a d/a $ cg-rm a $ cg-add d/a $ cg-commit

give the commit message and save
$ cg-seek nodirs

now I would expect to see the original directory, with no 'd' subdirectory, and just the 'a' file sitting there.

$ ls -F a d/ $

See the problem? The 'd' directory did not exist in this version of the repository, but it's there anyway.

Be well, Zack

Show 20 quoted lines
> 
> Specifically, this commit intends to remove empty directory from
> the working tree, where previously checked out tree object had
> files/directories inside while newly checked out tree does not.
> 
>     commit 340e4f88c083b0692e6554b1c2c27fd43c7cc8d3
>     Author: Junio C Hamano <junkio@cox.net>
>     Date:   Mon Oct 10 17:34:08 2005 -0700
> 
>         Remove empty directories after read-tree -u.
> 
>         This fixes everybody's favorite gripe that switching branch
>         with 'git checkout' leaves empty directories.
> 
>         Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Zack Brown
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “getting rid of extra directories”
  1. Zack BrownOct 15, 2005
  2. Junio C HamanoOct 15, 2005
  3. Zack BrownOct 15, 2005
  4. Junio C HamanoOct 15, 2005
  5. Three-way merge with the index as one wayPetr Baudis, Nov 3, 2005
  6. Junio C HamanoNov 3, 2005
  7. Petr BaudisNov 3, 2005
  8. Junio C HamanoNov 3, 2005
  9. Junio C HamanoNov 4, 2005

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.