DEV Community

Discussion on: How do you make it easier to search through version control for deleted code?

Collapse
 
gonedark profile image
Jason McCreary • Edited

While I think this is an interesting discussion and there are some good comments here, I question if this is a real problem.

The focus of Git is code - more accurately changesets. There is no other context. As such, the history Git forms only indirectly relates to how your project changed.

You can (and should) make individual commits for deleted code. You can (and should) add tags to mark contextual milestones for the project. But attempts to write a fuller commit message or copy changesets are ultimately trying to outsmart Git and yourself.

Gits job is not to remember you may need this code in the future. Gits job is simply to remember the code. You have to make the connection. That's a human job. You have to have some clues - what code, what file, around when? That's the hard part. From there it is easy, just use those clues to run git log commands.