All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@padd.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH] teach update-index --refresh about --data-unchanged
Date: Sun, 14 Nov 2010 11:58:19 -0500	[thread overview]
Message-ID: <20101114165819.GA8714@arf.padd.com> (raw)
In-Reply-To: <20101103220243.GA6777@arf.padd.com>

pw@padd.com wrote on Wed, 03 Nov 2010 18:02 -0400:
> jrnieder@gmail.com wrote on Wed, 03 Nov 2010 13:36 -0500:
> > On Wed, Nov 03, 2010 at 10:37:40AM -0700, Junio C Hamano wrote:
> > > Pete Wyckoff <pw@padd.com> writes:
> > 
> > >> When a repository has been copied with rsync, or cloned using
> > >> a volume manager, the index can be incorrect even though the
> > >> data is unchanged.  This new flag tells update-index --refresh
> > >> that it is not necessary to reread the data contents.
> > >
> > > I know our traditional attitude towards the plumbing commands have been
> > > "give them long enough rope and let users hang themselves", but this
> > > particular rope feels a bit too long for my taste.
> > 
> > Pete, I think you mentioned the possibility of a special-case tool for
> > contrib/ that just updates the inode, device number, and ctime fields?
> > That sounds a little less worrying to use, as plumbing.
> 
> Yes, I'd been discussing with Jonathan offlist that I too agree
> this is a bit bizarre for general use.  Especially when thinking
> about how to explain the new flag in the manpage, and how
> interactions with other command-line options should work.
> 
> I wrote a short C program to use existing functions from cache.h
> to read and write the index, updating the entries by hand.  Once
> I figure out how to build it nicely, I'll submit for contrib/.  I
> haven't figured out how to include the useful bits of the
> top-level Makefile (like SSL setting, which SHA1, -lpthread,
> etc.).

Turns out this was dead simple with dulwich, a python interface
to git internals:  http://samba.org/~jelmer/dulwich .  I got rid
of the C version.

The script uses dulwich to generate a list of index entries,
stats each file and updates the entries, then writes it back
out.  I won't submit it to contrib, since it is so trivial and
because it depends on dulwich.

		-- Pete

  reply	other threads:[~2010-11-14 16:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 17:44 index rebuild for cloned repo Pete Wyckoff
2010-10-31 18:07 ` Jonathan Nieder
2010-10-31 19:59 ` [PATCH] cherry-pick/revert: transparently refresh index Jonathan Nieder
2010-10-31 20:26   ` Andreas Schwab
2010-10-31 20:32     ` Jonathan Nieder
2010-10-31 22:26   ` Pete Wyckoff
2010-10-31 22:28     ` [PATCH] teach update-index --refresh about --data-unchanged Pete Wyckoff
2010-11-03 17:37       ` Junio C Hamano
2010-11-03 18:36         ` Jonathan Nieder
2010-11-03 22:02           ` Pete Wyckoff
2010-11-14 16:58             ` Pete Wyckoff [this message]
2010-11-14 17:34               ` Jonathan Nieder
2010-11-01  8:09   ` [PATCH] cherry-pick/revert: transparently refresh index Johannes Sixt
2010-11-03 17:30     ` Junio C Hamano
2010-11-03 20:33       ` Johannes Sixt
2010-11-01  8:44   ` Nguyen Thai Ngoc Duy

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=20101114165819.GA8714@arf.padd.com \
    --to=pw@padd.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /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.