All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hilco Wijbenga <hilco.wijbenga@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Kyle Moffett <kyle@moffetthome.net>,
	Michael Witten <mfwitten@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Evan Shelhamer <shelhamer@imaginarynumber.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Restoring timestamps (Re: Branches & directories)
Date: Mon, 22 Aug 2011 20:06:46 -0700	[thread overview]
Message-ID: <CAE1pOi1J=TWUmJKZorotBsDoz3wozXsioN7fVO=7JBxdMD7Zqg@mail.gmail.com> (raw)
In-Reply-To: <CAFzf2Xw6=BFsKauYTG-4cw0D_LzLSNb_wqz8dQJ83wJHNQXbdg@mail.gmail.com>

On 22 August 2011 16:21, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hilco Wijbenga wrote:
>
>> You mean an extra dotfile per file in the commit?
>
> Let me step back a moment.
>
> When you mentioned mtime, a switch went off and reminded me of the
> problem of metadata in general, especially owner and permissions. That
> problem is important for people keeping track of /etc or $HOME in
> version control (always a little dangerous because of the effect of a
> stray "git reset --hard", but never mind). And the last time it came
> up, I convinced myself that a hook script setting up entries in
> .gitattributes, .gitmetadata, or .etckeepr with information like "all
> files are owned by root:root unless otherwise specified" could be a
> good and not too invasive way to deal with that.
>
> Now that you remind me that the mtime of every file is likely to
> differ from every other file, it is harder to imagine what situation
> would make this meaningful information that should be stored in the
> repository and shared with other people. It seems more like something
> associated to the worktree, which fits more closely with what you are
> trying to do, anyway.

Yes, indeed.

> Regarding the problem "eclipse metadata is not carried over from one
> worktree to another", isn't that going to be a problem regardless? In
> your proposed setup, each time you stash everything and start work on
> a different branch, the eclipse metadata before would be stashed along
> with everything else, which doesn't make anything any easier (unless
> disk space is very scarce or metadata stores the absolute path to the
> cwd).

Eclipse is a wonderful IDE except for how it makes sharing workspaces
practically impossible (where "share" means "put in SCM", not "used my
several developers at the same time"). It's mostly (AFAICT) binary
data with lots of absolute paths. So it's a pain but it doesn't make
my scenario all that much more complicated.

The hard part is creating a new branch. Somehow I would need to
duplicate the state in the parent branch in the child branch. It needs
to be duplicated because I need to be able to do git stash in the
child branch *and* the parent branch. Is it possible to do git stash
pop without losing the stash? Or to "copy" a stash? Otherwise, it's
probably easier to simply write a separate script to do it. That
should not be very hard. I would not use git stash at all.

For a new branch, the script would
1. in "parent", move workspace (i.e. the root working dir, where .git
is)  into .git/branches/parent/
2. create and jump to "child"
3. in "child", copy .git/branches/parent into workspace (so creating a
new branch is no longer a cheap operation)

For an existing branch, the script would
1. in "current-branch", move workspace into .git/branches/current-branch
2. jump to "other-branch"
3. in "other-branch", move .git/branches/other-branch into workspace

The moves (assuming everything is on the same partition) should make
switching branches relatively cheap. Not very elegant (quite brute
force in fact) but it's simple and I think it would work. Or did I
overlook something? Better/other ideas are certainly welcome. :-)

  reply	other threads:[~2011-08-23  3:06 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 18:35 Branches & directories Hilco Wijbenga
2011-08-17 18:47 ` Evan Shelhamer
2011-08-17 19:14   ` Junio C Hamano
2011-08-17 21:23     ` Hilco Wijbenga
2011-08-18  4:45       ` Jonathan Nieder
2011-08-21 19:48         ` Hilco Wijbenga
2011-08-18  5:52       ` Michael Witten
2011-08-18 10:56         ` Michael J Gruber
2011-08-18 17:49           ` Michael Witten
2011-08-19  0:13         ` Jonathan Nieder
2011-08-21 20:25         ` Hilco Wijbenga
2011-08-21 20:53           ` Michael Witten
2011-08-21 21:37             ` Hilco Wijbenga
2011-08-21 23:06               ` Michael Witten
2011-08-21 23:35                 ` Hilco Wijbenga
2011-08-22  0:07                   ` Michael Witten
2011-08-22  0:47                     ` Hilco Wijbenga
2011-08-22  1:53                       ` Hilco Wijbenga
2011-08-22  2:05                       ` Michael Witten
2011-08-22  2:13                         ` Hilco Wijbenga
2011-08-22  3:01                           ` Kyle Moffett
2011-08-22  5:36                             ` Hilco Wijbenga
2011-08-22 12:46                               ` Kyle Moffett
2011-08-22 18:49                                 ` Hilco Wijbenga
2011-08-22 19:31                                   ` Kyle Moffett
2011-08-22 20:10                                     ` Hilco Wijbenga
2011-08-22 21:01                                       ` Restoring timestamps (Re: Branches & directories) Jonathan Nieder
2011-08-22 22:33                                         ` Hilco Wijbenga
2011-08-22 23:21                                           ` Jonathan Nieder
2011-08-23  3:06                                             ` Hilco Wijbenga [this message]
2011-08-23  3:20                                               ` Hilco Wijbenga
2011-10-02 15:06                                               ` Enrico Weigelt
2011-10-02 22:29                                                 ` Hilco Wijbenga
     [not found]                                               ` <CA+sFfMf=gi5CWyfZEt-Nmdr4J9g__maQTqy1WePr1x8D-AVr4A@mail.gmail.com>
2011-10-02 22:25                                                 ` Hilco Wijbenga
2011-08-23 14:46                                       ` Branches & directories Michael Witten
2011-10-02 16:57                                       ` Robin Rosenberg
2011-10-02 17:31                                         ` Ronan Keryell
2011-10-02 19:09                                           ` Matthieu Moy
2011-10-02 23:45                                             ` Hilco Wijbenga
2011-10-02 23:40                                         ` Hilco Wijbenga
2011-10-03  3:07                                           ` Jeff King
2011-10-03  7:15                                             ` Hilco Wijbenga
2011-10-03  7:30                                               ` Jeff King
2011-10-03  7:32                                               ` Matthieu Moy
2011-10-03  7:34                                                 ` Jeff King
2011-10-03  7:41                                                   ` Matthieu Moy
2011-10-03  7:44                                                     ` Jeff King
2011-10-03  7:48                                                       ` Junio C Hamano
2011-10-03  7:51                                                         ` Jeff King
2011-10-03 17:31                                                 ` Hilco Wijbenga
2011-10-03 14:59                                               ` Robin Rosenberg
2011-10-03 17:20                                                 ` Hilco Wijbenga

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='CAE1pOi1J=TWUmJKZorotBsDoz3wozXsioN7fVO=7JBxdMD7Zqg@mail.gmail.com' \
    --to=hilco.wijbenga@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=kyle@moffetthome.net \
    --cc=mfwitten@gmail.com \
    --cc=shelhamer@imaginarynumber.net \
    /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.