Re: Hash for a commit sourcetree beside to a commit hash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Git,



Friday, February 3, 2023, 4:28:37 AM, you wrote:

A> Hello Git,

A> Is there a chance to add this property to a commit and a set of commands, for example, to search a commit by a sourcetree hash?

I've suddenly found another interesting ability of such hash. It could may restore a commit submodule add/update reference hashes to submodule commits after submodule repo rewrite.

Lets say you have 2 repositories.

```
[Repo A] of Owner A

  ...
  |
  Commit A1
  | |
  | +-- submodule add/update hash B1
  |
  Commit A2
  | |
  | +-- submodule add/update hash B2
  |
  ...

[Repo B] of Owner B (submodule to A)

  ...
  |
  Commit B1
  |
  Commit B2
  |
  ...
```

If owner of [Repo B] would try to rewrite repository because, for example, of a mistake in the commit author email address,
then [Repo A] becomes broken and will reference invalid hashes.
Hard to rewrite hashes in [Repo A] because of unrelated histories and tricky algorithm with the hash mappings.

But if add a second hash into a commit property as hash of an ordered sourcetree diff, then
we can automatically map such hashes even in unrelated histories.
Because basically a commit hash changes because of change in a commit properties instead of in the source tree.
And even a change in source may not lead to trigger changes in following commits because depends on the context and
the sources intersection (including source movement).

So the git could suggest with these hashes a semi automatic merge even if a repo was rewriten.
Of cause this needs additionally to detect changes in all properties to show to the user before semi automatic merge.

In case of [Repo A] it just needs to add second hash into [repo A] submodule add/update and now you can rewrite [Repo A]
through the mapping by ordered sourcetree diff hash.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux