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

Re: [PATCH] git svn: reset invalidates the memoized mergeinfo caches

From
EWEric Wong <normalperson@yhbt.net>
Date
Aug 8, 2012, 22:52 UTC
Message-ID
<20120808225258.GA24956@dcvr.yhbt.net>
In-Reply-To
<20120808054129.GB10899@m62s10.vlinux.de>
Peter Baumann <waste.manager@gmx.de> wrote:
Show 19 quoted lines
> On Tue, Aug 07, 2012 at 08:45:10PM +0000, Eric Wong wrote:
> > Peter Baumann <waste.manager@gmx.de> wrote:
> > > +			for my $suffix (qw(yaml db)) {
> > > +				unlink("$cache_file.$suffix");
> > 
> > Need to check for unlink() errors (and ignore ENOENT).
> 
> I'm not sure what you mean here: Aren't we screwed either way if unlinking
> the file failed? There is nothhing we can do about it if e.g. the user doesn't
> have the permissions to delete the file, besides terminating, e.g.
> 
> 	for my $cache_file (("$cache_path/lookup_svn_merge",
> 			     "$cache_path/check_cherry_pick",
> 			     "$cache_path/has_no_changes")) {
> 		for my $suffix (qw(yaml db)) {
> 			next unless (-e "$cache_file.$suffix");
> 			unlink("$cache_file.$suffix") or 
> 				die "Failed to delete $cache_file.$suffix";
> 		}

Yes we're screwed, but silent failure is the worst way to fail, especially if it can lead us back to the problems your patch is meant to address.

Perhaps something like this (with $! to show the error):
			my $file = "$cache_file.$suffix";
			next unless -e $file;
			unlink($file) or die "unlink($file) failed: $!\n";
Previous: Peter BaumannNext: Peter Baumann
Message 4 of 9 in “git svn: reset invalidates the memoized mergeinfo caches”
  1. git svn: reset invalidates the memoized mergeinfo cachesPeter Baumann, Aug 7, 2012
  2. Eric WongAug 7, 2012
  3. Peter BaumannAug 8, 2012
  4. Eric WongAug 8, 2012
  5. git svn: reset invalidates the memoized mergeinfo cachesPeter Baumann, Aug 9, 2012
  6. Steven WalterAug 9, 2012
  7. Eric WongAug 10, 2012
  8. Junio C HamanoAug 10, 2012
  9. Eric WongAug 10, 2012

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.