#5144 Set git hashes length to 7
Merged 2 years ago by ngompa. Opened 3 years ago by josseline.
josseline/pagure short-length-config  into  master

@@ -85,7 +85,7 @@ 

  MAX_CONTENT_LENGTH = 4 * 1024 * 1024  # 4 megabytes

  

  ### Lenght for short commits ids or file hex

- SHORT_LENGTH = 6

+ SHORT_LENGTH = 7

  

  ### IP addresses allowed to access the internal endpoints

  ### These endpoints are used by the milter and are security sensitive, thus

file modified
+1 -1
@@ -142,7 +142,7 @@ 

  MAX_CONTENT_LENGTH = 4 * 1024 * 1024  # 4 megabytes

  

  ### Lenght for short commits ids or file hex

- SHORT_LENGTH = 6

+ SHORT_LENGTH = 7

  

  ### List of blacklisted project names that can conflicts for pagure's URLs

  ### or other

file modified
+1 -1
@@ -283,7 +283,7 @@ 

  CHECK_SESSION_IP = True

  

  # Lenght for short commits ids or file hex

- SHORT_LENGTH = 6

+ SHORT_LENGTH = 7

  

  # Used by SESSION_COOKIE_PATH

  APPLICATION_ROOT = "/"

Resolves: #5067

  • Update SHORT_LENGTH to 7

:thumbsup:

This is technically not backward compatible (though I don't think people rely really on this).

Thanks for your reply @pingou, this is my first approach to Pagure :)

Why this approach is not backward compatible? When I did it I noticed this change would affect only how the commit hash is presented in the template. Does it affect any stored data?

It makes it so that URL slugs referencing commits with 6 characters doesn't work anymore, but I think that doesn't actually happen much in practice.

Why this approach is not backward compatible? When I did it I noticed this change would affect only how the commit hash is presented in the template. Does it affect any stored data?

Your approach is correct, the very nature of changing the default configuration
is not backward compatible. It is fine, just something to be aware of :)
(especially regarding the version of pagure that has this code change)

Hi @pingou, sorry but I did not understand if I have to change something :sweat_smile:

rebased onto 0f7788b

2 years ago

Pull-Request has been merged by ngompa

2 years ago

@josseline Your patch was in good shape, so I merged it. Thanks for the patch!