Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Conversation

@frerich
Copy link
Owner

@frerich frerich commented Aug 24, 2016

No description provided.

Frerich Raabe added 3 commits August 24, 2016 12:58
The 'listOfIncludeHashes' list was only used to get a list of the hashes
of the contents of all include files. However, we already have this
list: the given 'includes' dictionary has the hashes of all include
files as the values, and by the time we get to the end of
'listOfIncludeHashes' we already verified that all the include files
exist and they still have the same hashes.
This patch moves the code for verifying that the list of includes (and
the hash code of the include file contents) is accurate into a separate
function. The reason for this is that I think that not all users of
ManifestRepository.getIncludesContentHashForFiles() need this
functionality...
When creating manifests, we would first compute the list of included
files, then commpute the hash code of their contents and then call
ManifestRepository.getIncludesContentHashForFiles(). That function would
then re-compute the file hash for each file to see whether it's still
the same, but there's no point in doing so since we just computed the
hash!
@frerich frerich force-pushed the simplify_hashing_included_code branch from a479f44 to 49b0bbf Compare August 24, 2016 11:10
@codecov-io
Copy link

codecov-io commented Aug 24, 2016

Current coverage is 79.35% (diff: 100%)

Merging #216 into master will increase coverage by 0.02%

@@             master       #216   diff @@
==========================================
  Files             1          1          
  Lines           958        959     +1   
  Methods           0          0          
  Messages          0          0          
  Branches        158        158          
==========================================
+ Hits            760        761     +1   
  Misses          161        161          
  Partials         37         37          

Powered by Codecov. Last update aced99a...49b0bbf

@webmaster128
Copy link
Contributor

While this change makes sense for the current code base, I think it harms the work towads updating a manifest. For example, the includes map is likely to change from a path->hash map to a path->list_of_hashes map, in order to be able to deal with multiple include contents.

Removing the redundant reading of includes when creating a manifest is cool. But I think that part will be generalized and changed a lot.

So I would just open an issue pointing out the problem and try to implement it with/after a solution for #212

@frerich
Copy link
Owner Author

frerich commented Aug 24, 2016

I see, I don't know what you're planning to do with #212 exactly, so I'll just keep this PR around.

@frerich
Copy link
Owner Author

frerich commented Sep 7, 2016

This got obsoleted now that #222 was merged.

@frerich frerich closed this Sep 7, 2016
@frerich frerich deleted the simplify_hashing_included_code branch September 7, 2016 17:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants