ssc-oscar / lookup

A mirror of bitbucket.org/swcs/lookup
1 stars 4 forks source link

Linking a project to its blobs/filename #39

Closed k----n closed 1 year ago

k----n commented 1 year ago

It's trivial to list a project to a blob, or a project to a filename with P2b and P2f.

What's the best way to link the b and f together?

It is possible to use P2f then f2b and checking if the f2b output (which can be quite long) is within P2b, but it seems like there should be an easier way to do this.

Here are some of the strategies that didn't work:

# Doesn't work because it will list all blobs with the same filename
echo "Stijnn_Section_05" | getValues -f P2c | cut -d\; -f2- | getValues -f c2f | cut -d\; -f2 | getValues -f f2b

# Doesn't work because it will list filenames that are not part of a project
echo "Stijnn_Section_05" | getValues -f P2b | cut -d\; -f2- | getValues -f b2f

# Doesn't work because it will output blobs that are not part of the project
echo "Stijnn_Section_05" | getValues -f P2f | cut -d\; -f2- | getValues -f f2b
k----n commented 1 year ago

It also appears that the output of P2b and P2f are not 1 to 1, i.e., the outputs do not align.

When I run:

echo "Stijnn_Section_05" | getValues -f P2f | head -n1

The first filename is .gitignore

When I check the filename of the first blob for .gitignore, I get no results.

echo "Stijnn_Section_05" | getValues -f P2b | head -n1 | cut -d\; -f2- | getValues -f b2f | grep gitignore
k----n commented 1 year ago

P2c -> c2f and P2b -> b2f are also not 1 to 1.

k----n commented 1 year ago

Seems to be a repeat of my previous question here: https://github.com/ssc-oscar/lookup/issues/36

Possible solution is outlined here: https://github.com/woc-hack/tutorial/issues/46

audrism commented 1 year ago

Correct: the relations return sets, to get the full tuple, you need to use one form of c2fbb/b2obcf/ob2bcf