Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing Git for Windows 2.x on top of 1.x, make sure to clean up #107

Closed
dscho opened this issue Apr 23, 2015 · 2 comments
Closed

Comments

@dscho
Copy link
Member

dscho commented Apr 23, 2015

It is a bit unclear how this worked previously to this developer (who got the impression that reinstalling via the Inno installer would automatically delete previously installed files, but according to this comment that is wrong...)

So we need to make sure that 32-bit Git is removed when installing 64-bit Git.

We should also make sure to move the old config to %PROGRAMDATA%\Git\config (or on XP, %ALLUSERSPROFILE%\Application Data\Git\config) and to make our modifications there instead of /mingw??/etc/gitconfig (we should also make sure that we remove the respective keys from the latter location, probably already in git-extra).

@bviktor
Copy link

bviktor commented Apr 29, 2015

You may wanna have a look at the HexChat installer.

@dscho
Copy link
Member Author

dscho commented Apr 30, 2015

@bviktor I know you want to help, but our InnoSetup script looks quite different, so it may not have been the best idea to send me to the HexChat installer. Please have a look at Git for Windows' InnoSetup script, compare for yourself how different it is from the HexChat installer, and then maybe try to figure out how to apply the lesson from HexChat's installer to Git for Windows'? I would be really glad to accept a Pull Request in that regard.

jeffhostetler pushed a commit to jeffhostetler/git that referenced this issue Jan 7, 2019
… for expire

This replaces git-for-windows#106. That PR was complicated and difficult to understand because we didn't use structured data, but instead relied on our simple arrays and overloaded that data.

This is a bigger change, but results in code that is (hopefully) easier to understand. The new flow for writing a multi-pack-index is as follows:

1. Construct a list of `midx_info` structs that contain the details of the packs. This list starts with the packs in the existing midx, followed by the new packs to add.  Keep track of the `orig_pack_int_id` for these packs.

2. Construct the list of object entries. The `pack_int_id` we use here corresponds to the `orig_pack_int_id` for the pack we are using.

3. Sort the packs by name.

4. If we have packs to drop, identify where they are in the list of packs. We can use the sorted nature of the list to know we will find them in the correct order.

5. Determine the `new_pack_int_id` for each `struct midx_info` by tracking how many are dropped by that point in the list.

6. Construct a new permutation array that maps from `orig_pack_int_id` to `new_pack_int_id`. If the pack is expired, then the value used here is invalid and will error if any object tries to use that value.

7. Count the length of the pack names we will write, and modify the length to be properly aligned if necessary.

8. Write the midx as usual, tracking that we have `packs.nr - drop_count` packs to write.

9. When writing the object offsets, use `packs.perm` to translate from the `orig_pack_int_id` to `new_pack_int_id`.

While this PR is just one giant commit, I will peel parts across multiple commits for upstream. These will be interleaved with the commits already in `microsoft/git:master`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants