Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355313 - app-portage/layman: New option: use-commit-times
Summary: app-portage/layman: New option: use-commit-times
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 10:31 UTC by Dennis Schridde
Modified: 2011-08-22 10:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2011-02-17 10:31:22 UTC
It would be nice to have an additional option when updating repositories via layman, to use the file times of the commit, not of the checkout.

For SVN this works by adding following commandline option:
--config-option=config:miscellany:use-commit-times=yes

For Git you need an extra script which can be found here:
https://git.wiki.kernel.org/index.php/ExampleScripts#Setting_the_timestamps_of_the_files_to_the_commit_timestamp_of_the_commit_which_last_touched_them

I have no investigated how other version control systems handle this.

Reproducible: Always
Comment 1 Dennis Schridde 2011-02-17 21:16:20 UTC
The benefit of preserving commit mtimes is that you can generate metadata for overlays and that users can then use that metadata for their own checkouts of these overlays.

Not all overlays provide metadata, and for many it would be very cumbersome or impossible because of limited access to post-push/-commit hooks and lacking Gentoo facilities on the repository server.
Comment 2 Dennis Schridde 2011-02-17 21:17:38 UTC
P.S: The usefulness of metadata for overlays lies in eix requiring it to sync/update reasonably fast.
Comment 3 Dennis Schridde 2011-02-17 21:27:47 UTC
Because it came up on IRC:
If you do not want to add the option directly to layman, but rather want to implement post-sync commands, I suggest this (example):

layman.cfg:
---
postsync_command : my_git_script.sh
---

my_git_script.sh:
---
#!/bin/sh
REPOS_TYPE=$1
REPOS_PATH=$2

[[ "$REPOS_TYPE" = "git" ]] || exit 0
---
Comment 4 Dennis Schridde 2011-02-17 21:54:23 UTC
That way the user can also run the command only for overlays he needs it for, and you dont have to worry about all that.

It also does not clutter the config file as much as a bunch of backend specific settings.
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2011-02-17 22:17:35 UTC
While I can agree with you that method is simple for you or a power user. I see it as a much higher potential for user error caused bugs and confusion.

I think the individual postsync hooks will be less problematic and difficult to use for less experienced users.  While there may be more code changes involved in the backends (they are very minor) it will be more solid solution as well make the backends a little more flexible for existing and future repo types.

I'll make the change to the git type first and post it for you to test and peruse.
Comment 6 Brian Dolbec (RETIRED) gentoo-dev 2011-02-18 05:52:55 UTC
Ok, done: I've added per repo type config postsync options.

commit: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=3eaca0340384122c5d83e0aa2d0a8b6dc1165487

While it is not capable of filtering to only run on certain repos of the type.  A simple filter script can be placed in to run and perform necessary actions.  For noobs, a simple premade, dropin script/command can be added easily.  For power users they can add in custom scripts to do precise work.

I think this is the best of both methods.  At least it is the one I did ;)

enjoy and test lots please.
Comment 7 Brian Dolbec (RETIRED) gentoo-dev 2011-08-20 17:42:47 UTC
I'd forgotten to mention that I have also added per repo type add, sync options which will be added to the defaults for running the svn, etc. commands.  You should be able to do all you asked for now.

Please report as to whether or not both new features does or does not work for you.
Comment 8 Dennis Schridde 2011-08-22 10:14:11 UTC
From the description it seems sufficient, but I did not test them in the wild yet. Assuming they work as advertised, I am closing this bug. Thanks for your support!