Page MenuHomePhabricator

Add a `getWorkingCopyTimestamp` function to `ArcanistRepositoryAPI`.
AbandonedPublic

Authored by joshuaspence on May 23 2014, 2:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 7 2024, 9:44 PM
Unknown Object (File)
Sep 18 2024, 3:12 PM
Unknown Object (File)
Sep 15 2024, 1:40 AM
Unknown Object (File)
Sep 15 2024, 1:39 AM
Unknown Object (File)
Sep 15 2024, 1:39 AM
Unknown Object (File)
Sep 1 2024, 12:38 AM
Unknown Object (File)
Aug 27 2024, 12:53 PM
Unknown Object (File)
Aug 25 2024, 12:30 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Summary

This function returns a timestamp for the working copy revision.

Test Plan

Tested manually by executing the raw commands in a git, hg and svn repository.

Diff Detail

Repository
rARC Arcanist
Branch
repo-timestamp
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 666
Build 666: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Add a `getWorkingCopyTimestamp` function to `ArcanistRepositoryAPI`..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

Hrrm, what's the goal of this?

The behavior might be confusing if the working copy isn't clean.

epriestley edited edge metadata.

I think this probably gets into a lot of sketchy territory. For example:

  • I think the name "working copy timestamp" is a bit misleading, as my first assumption was that it included the modification times of dirty files. We could name this something like "getMostRecentCommitOnCurrentBranchTimestamp()" to resolve this.
  • This probably does not work correctly in empty repositories in any of the VCSes?
  • I can't really think of uses for this other than D9265. Use cases I can imagine would maybe be better served with a slightly more general getCommitInformation($commit) sort of API. There's some precedent for this in getLocalCommitinformation().
  • (And I'm pretty sure I caught one actual issue.)

Rather than expose somewhat-misleading, sort-of-functional, maybe-not-really-that-useful public API, what do you think about hard-coding the git actions in arc version for now instead? We could generalize them eventually after developing a better use case for this, or building getCommitInformation($commit), or whatever else.

src/repository/api/ArcanistMercurialAPI.php
516–518

This one definitely doesn't work, since it doesn't return?

This revision now requires changes to proceed.May 23 2014, 4:10 PM

Yeah, let's just build this inline in D9265.